Heres the criteria from UEFA
http://www.uefa.com/MultimediaFiles.../Regulations/01/63/02/44/1630244_DOWNLOAD.pdf
Page 10 >11
If two or more teams are equal on points on completion of the group
matches, the following criteria are applied to determine the rankings (in
descending order):
a) higher number of points obtained in the group matches played among the teams in question;
b) superior goal difference from the group matches played among the teams in question;
c) higher number of goals scored in the group matches played among the
teams in question;
d) higher number of goals scored away from home in the group matches
played among the teams in question;
e) if, after having applied criteria a) to d), two teams still have an equal
ranking, criteria a) to d) are reapplied to determine the final ranking of the
two teams. If this procedure does not lead to a decision, criteria f) to h)
apply;
f) superior goal difference from all group matches played;
g) higher number of goals scored from all group matches played;
h) higher number of coefficient points accumulated by the club in question,
as well as its association, over the previous five seasons (see
paragraph 9.02).