The offside law (Law 11) is the most argued-over law wherever in the world the game of football is played, even though it’s pretty simple. Here’s how it works.
A player is caught offside if he’s nearer to the opponents’ goal than both the ball and the second-last opponent when his team-mate plays the ball. In other words, a player can’t receive the ball from a team-mate unless there are at least two players either level with him or between him and the goal.
It is not an offence in itself to be offside. A player is only penalised for being offside if he is deemed to be involved in active play. So a player can only be called offside if he is:
In the opposition’s half.
Interfering with play (that is, he’s part of the attacking move).
Interfering with an opponent (that is, he’s preventing the opponent from defending against the attacking move).
Gaining any advantage by being in that position.
A player cannot be offside from a goal kick, throw in or corner.