Offside explained in plain English
Offside confuses new fans because the rule has two parts: where a player stands, and what they do. Both must be true before the flag goes up.
Being in an offside position
A player is in an offside position if any part of their head, body or feet is in the opponents' half and closer to the opponents' goal line than both the ball and the second-last opponent. The goalkeeper usually counts as one opponent, so in practice it is often the last defender who sets the line. Hands and arms are not counted, and being level with the defender is onside.
When it becomes an offence
Standing in an offside position is not an offence on its own. A player is only penalised if, when a teammate plays the ball, they then become involved in active play by playing the ball, interfering with an opponent or gaining an advantage from where they stand.
When offside does not apply
A player cannot be offside directly from a goal kick, a throw-in or a corner kick. They also cannot be offside in their own half.
Technology
Video assistant referees (VAR) check close offside decisions after a goal. Some competitions now use semi-automated offside technology, which tracks players with cameras to speed up the decision. The rule is the same, only the speed of applying it has changed.