In rugby football, the offside rule prohibits players from gaining an advantage from being too far forward. The specifics of the rule differ between the two major codes.
Offside laws in rugby union are complex. However the basic principle is simple: a player may not derive any advantage from being in front of the ball.
When the ball is carried by a single player in open play, any other player on the same team who is in front of the ball carrier is in an offside position. When the ball is in a ruck, maul, scrum or line-out, any player who is in front of the hindmost foot of the hindmost player of the same side in the ruck/maul/scrum/lineout is in an offside position. When the ball is in a scrum, the scrum-half must remain behind the ball and all other players not in the scrum must remain behind a line parallel to the goal-line and five metres behind the hindmost foot. A player in an offside position is forbidden from interfering with play in any way. In particular, a player in an offside position
Infringement of any of these rules is generally punished with a penalty awarded to the opposing team. The opposing team may choose instead a scrum at the location where the offending team last played the ball. However, if the infringement was accidental (e.g. a player receives a forward pass without intending to be in an offside position) then a scrum is awarded at the location of infringement.
A player who is in an offside position remains offside until played onside in one of several ways:
At a lineout only players in the line (normally 7 per team), a receiver (often the scrum-half) and a thrower (usually the hooker) from each team are allowed within 5 metres of the line, however the defending hooker must be at least 2 metres from the line so as not to disturb the other thrower. The remaining players must be more than 10 metres away from the line or they will be penalised. They may move closer only to catch a long throw-in, or after the line-out ends, when the ball or a player carrying it leaves the lineout in any direction.
If a player kicks the ball, out of hand, from the dead ball area, players can be in front of the kicker, as long as they do not leave the dead ball area before the ball has been kicked.
A defending player is offside if he/she is less than 10m away from the play-the-ball (or, if the play-the-ball is inside his 10m line, closer to it than the try-line is) when the ball is played. He is also offside if, during open play, he is closer to the opposition's try-line than the ball. At a scrum a defending player is also offside if he is less than 5m away from the base of the scrum.
An attacking player is offside if he is in front of the ball: if he is in front of a ball which is then kicked, he can be put onside if the kicker subsequently moves ahead of him before the ball is caught. If not, he must stand 10m away from the player who catches the ball (as if he were the acting half-back at a play-the-ball) or be penalised.