Spain and Croatia go into the game in pole position - able to control each other's own destiny by engineering a 2-2 draw. With that result, both teams would go through to the quarter-finals no matter what Italy do.
An Italy win and a draw in the Spain-Croatia game would leave all three sides level on five points, and with the games involving the three sides all finishing as a draw it goes down to goals scored in the mini-league.
If Spain-Croatia finishes 0-0 then Italy would go through as group winners, they will have scored two goals to Spain and Croatia's one, with second place decided by overall group goal difference. That means Spain would go through in second with +4 to Croatia's +2.
If Spain-Croatia finishes 1-1 then it would come down to group goal difference between the three sides, as all three matches will have been drawn by the same scoreline. Spain would be guaranteed to qualify by virtue of their better goal difference with Croatia. If Italy beat Ireland by one goal, or 2-0, they will only finish third in the group. If Italy beat Ireland 3-1 then records will be level and qualification will be decided on each nation's position in the UEFA national team coefficient ranking system - and that would put Italy though in second ahead of Croatia..
That means that a 3-1 win for Italy, or a two-goal victory of a larger score, or victory by three goals or more, would guarantee their place with a 1-1 draw between Spain and Croatia. With that 1-1 draw Italy can only top Group C if they beat Ireland 5-0, or with a four goal victory of a scoreline 5-1 or higher.
The 2-2 draw, or higher scoring draw, would guarantee Spain and Croatia go through on head to head goals scored with Italy eliminated no matter what margin they beat Ireland by. Spain would top the group with Croatia in second.
At Euro 2004, the same fate befell Italy when a Denmark-Sweden draw of 2–2 or higher would eliminate Italy on goals scored in matches between the three sides regardless of Italy's result. Denmark and Sweden draw 2-2.
http://espnfc.com/en/features/1099715/group-permutations.html