In soccer, an offside occurs when a player who is in the opposing team's half of the field is nearer to the goal line than both the ball and second-to-last opponent. The player must also be involved in the play.
Picture an imaginary line parallel to the goal line, on the last defender. If the offensive striker is past this line when the ball is passed, then he is offside. If the offensive striker is on the same line as the final defender when the ball is passed, then he is in a legal position. It does not matter where the striker is when receiving the ball. The offside is called the moment the ball is passed.