Offside rules in rugby union appear particularly complex to the casual observer. Often the only indication that they have been infringed occurs when the referee blows the whistle. This, therefore, is only a basic attempt to explain offside in the context of rugby union.
While in play, when a side is in possession, players are offside if they are in front of the ball carrier. This means that they cannot receive any passes (in which case a forward pass would have occurred) or kicks from the ball carrier. If offside players do participate in the game, for example by playing the ball or obstructing an opponent (by loitering), then their team will be penalised – in the case of a forward pass, with a scrum; in the case of a kick received offside, a scrum if accidental or a penalty otherwise.
A player can become onside, so long as he is retreating, if he is passed by the original kicker or another player on the same side who was behind the ballplayer at the time of the kick.
In any other part of play (scrums, rucks, mauls or line-outs), players are offside if they are in front of the off-side line. This is an imaginary line parallel to the goals which runs through the hindmost foot of the hindmost player in the ruck/maul/scrum (but also see the Experimental law variations). Any players joining a ruck/maul or scrum from in front of the off-side line are offside and their team will be penalised.
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. The remaining players must be more than 5 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.
Adapted from Wikipedia