The lineout is a means of restarting play after the ball has gone into touch (after the ball has been knocked or kicked out of play past the touch line). The line-out consists of three to eight players from each side, up to 16 in total (extremely rare), and is taken where the ball went out of play.
The aim of each player is simply to work together to get their hands on the ball for their team. So how does it work? The advantage is with the team throwing in. They get the ball because they were not the team who last touched the ball before it went out. They also get to decide how many players will make up the line-out.
FORMING A LINE-OUT.
The eight forwards and the scrum-half are the players who usually make up the line-out: one throwing the ball in (usually the hooker), 7 forwards in the line-out, and the scrum-half who receives the ball.
The most important players are the hooker, the jumpers (two second rows and 1 or 2 loose-forwards) and scrum-half. That does not mean the other players have nothing to do. Far from it. The jumpers have lifters who help get the jumper high in the air to receive the ball thrown in by the hooker. This take a lot of work and practice.
The hooker is usually the player with the job of throwing the ball into a line-out. Their aim of course is to find the "jumpers". But this is not so easy. The other team also want the ball, so they'll be doing all they can to upset the hooker's throw and competing for the ball. The hooker gets a call from one of the jumpers or the scrum half, usually in a code no-one except your team understands, on who to aim the throw at.
The player who successfully catches the ball can keep it and set up a maul, or can pass to the receiver (usually the scrumhalf) who then passes to the fly half and on to the back line..
This is a very brief overview of the lineout, please look at the Positions page for more detailed info pertaining to the role of each player at the lineout.
Of course it is essential that you read and understand the lineout laws!