The rules are as follows:
Source: http://www.rugbyworldcup.com/home/tournamentrules/index.html
Rankings at the completion of the pool phase
At the completion of the pool phase, the teams in a pool are ranked one through five based on their cumulative match points, and identified respectively as winner, runner-up, third, fourth and fifth.
If at the completion of the pool phase two or more teams are level on match points,
then the following criteria shall be used in the following order until one of the Teams can be determined as the higher ranked:
The winner of the match in which the two tied teams have played each other shall be the higher ranked;
The team which has the best difference between points scored for and points scored against in all its pool matches shall be the higher ranked;
The team which has the best difference between tries scored for and tries scored against in all its pool matches shall be the higher ranked;
The team which has scored most points in all its pool matches shall be the higher ranked;
The team which has scored most tries in all its pool matches shall be the higher ranked;
Should the tie be unresolved at the conclusion of steps 1 through 5, the team that is higher ranked in the updated Official IRB World Rankings on October 3, 2011.