Messi can do it now, it is totally in his hands, although Iceland already has 4 points (Croatia is 1st anyway).
Here are the rules for ranking (if you want to have a headache imagining scenarios
)
The ranking of each team in each group shall be determined as follows:
a) greatest number of points obtained in all group matches
b) goal difference in all group matches
c) greatest number of goals scored in all group matches
If two or more teams are equal on the basis of the above three criteria, their rankings shall be determined as follows:
d) greatest number of points obtained in the group matches between the teams concerned
e) goal difference resulting from the group matches between the teams concerned
f) greater number of goals scored in all group matches between the teams concerned
g) greater number of points obtained in the fair play conduct of the teams based on yellow and red cards received in all group matches as follows:
– yellow card: minus 1 point
– indirect red card: minus 3 points (as a result of a second yellow card)
– direct red card: minus 4 points
– yellow card and direct red card: minus 5 points
Only one of the above deductions shall be applied to a player in a single match
h) drawing of lots by the FIFA Organising Committee