Scenario after the second round 

All scenarios except 5-5-5-0 do not involve a three-way tiebreaker, so I only explain the 5-5-5-0 situation below.
If Spain draw with Republic of Ireland and Italy defeat Republic of Ireland, the three teams Spain, Republic of Ireland and Italy will have 5 point each, and 2 points each and 0 goal difference each among the three games among themselves. If the Spain-Republic of Ireland match ends at a draw of 2–2 or higher, Spain and Republic of Ireland will advance due to higher number of goals from games among teams in question. If the draw game is goalless, Italy will advance with a higher number of goals among teams in question while Spain and Republic of Ireland still tie. As reapplying the tiebreaker on the game between Spain and Republic of Ireland doesn't help, Spain will advance (with Italy) with a higher overall goal difference. If the draw is 1–1, the tiebreaker on overall goal difference applies. Therefore, the two teams with the best results against Republic of Ireland advance.