Law #11 may be the most confusing of the Laws of the Game.
It is not an offence in itself to be in an offside position.
A player is in an offside position if:
- he is nearer to his opponents’ goal line than both the ball and the second-last opponent
A player is not in an offside position if:
- he is in his own half of the field of play or
- he is level with the second-last opponent or
- he is level with the last two opponents
A player in an offside position is only penalised if, at the moment the ball touches or is played by one of his team, he is, in the opinion of the referee, involved in active play by:
- interfering with play or
- interfering with an opponent or
- gaining an advantage by being in that position
There is no offside offence if a player receives the ball directly from:
- a goal kick
- a throw-in
- a corner kick
Infringements and sanctions
In the event of an offside offence, the referee awards an indirect free kick to the opposing team to be taken from the place where the infringement occurred (see Law 13 – Position of free kick).
This explains it well:
This might not clear things up, but it’s funny: