Goals scored by goalkeepers are a somewhat rare event in football. Goalkeepers spend the majority of a match in the penalty area of their own team, a marked area around the goal they are defending in which they can handle the ball, in order to defend their goal. It is highly unusual for a goalkeeper to move far beyond this area and join an attack, as this leaves the defence vulnerable to long-distance attempts until the goalkeeper can return to defend it.
The most prolific goalscoring goalkeepers are those who take penalties or free kicks. Other occasions where goalkeepers sometimes score include set pieces where a goalkeeper joins an attack when a team desperately needs a goal to win or prevent a defeat, or from goal kicks or otherwise regular clearances which travel the length of the pitch into the opposite goal. These types of instances are generally extremely rare and when they do happen it is generally considered a fluke or a stroke of luck rather than the intended consequence.