Ghana advances with a win. If it draws, it must hope South Korea does not win by two or more goals. If it loses, it is out. Uruguay must win. If it does, it will advance unless South Korea wins by an equal or larger margin.
Portugal has clinched advancement. South Korea must win and get help. If Uruguay wins the other game, South Korea must win by an equal or better margin. If the other game ends in a draw, South Korea must win by two goals to assure it goes through.