For most of a football match, the goalkeeper stays near his goal and is usually the closest defending player to the goal line. Occasionally, whether to come out for an attack in the last minute of the game or to catch a ball from a cross, he will come off his line and is no longer the closest defender to the goal line.
So, what’s the offside rule when the goalkeeper is out of his goal? The goalkeeper counts the same as any other player, so if the keeper comes out of his goal there must now be two outfield players between the attacking player and the goal line to remain onside.
Other offside rules remain in play. For example if the player receiving the pass is behind the ball when it’s played, he is considered onside regardless of whether or not there are defenders between him and the goal line.
What does the official rule state?
The rule states a player is in an offside position if:
Any part of the head, body or feet is nearer to the opponents’ goal line than both the ball and the second-last opponent.www.thefa.com/football-rules-governance/lawsandrules/laws/football-11-11/law-11—offside
As you can see, it doesn’t specify a goalkeeper and a defender, it states the second-last opponent. So if the goalkeeper is out of his goal, there must still be two players (in this case two outfield players) between the attacker and the goal line for it to be onside.
A video example
Check out the video below for an example of a good refereeing decision by the linesman when the keeper comes off his line.
The commentators seem sure that the decision is incorrect because there is a defender stood right on the line. But you can also see that the keeper is off his line and behind the attacker as he scores the goal. So here there is only one defender between the attacker and the goal line so the offside decision is correct.
Thanks for reading!