In the league system the ranking in each group is determined as follows:
(a) greater number of points obtained in all the group matches;
If two or more teams are equal on the basis of the above criterion, their ranking shall be determined as follows:
(b) greater number of points obtained in the group matches between the teams concerned;
(c) goal difference resulting from the group matches between the teams concerned;
(d) greater number of goals scored in the group matches between the teams concerned;
(e) goal difference in all the group matches;
(f) greater number of goals scored in all the group matches;
(g) a play-off on neutral ground.
Taken from: Regulations 2006 FIFA World CupTM Germany page 6