The law states that if a player is in an offside position when the ball is played to him or touched by a teammate, he may not become actively involved in the play.
A player is in an offside position if he is closer to the goal line than both the ball and the second-to-last defender, but only if he is in the opposition half of the field. To be offside, a player must:
The 2005 edition of the Laws of the Game state that being "nearer to an opponents' goal line" means that "any part of his head, body or feet is nearer to his opponents' goal line than both the ball and the second-last opponent (the last opponent typically being the goalkeeper). The arms are not included in this definition". So to be in an offside position, any part of the attacking player named in this decision has to be beyond the part of the second-last defender closest to his goal line (excluding the arms) and past the part of the ball closest to the defenders' goal line.
A player cannot be offside when receiving the ball directly from a goal kick, corner kick, or throw-in.
If a player is caught offside, an indirect free kick shall be taken from the spot in which he was offside when the ball was played forward.