Nawawi (Allah have mercy on him) stated in his al-Adhkar that it is permitted to pray for guidance for non-Muslims, good health well-being, and the like, because of the hadith of Anas (Allah be pleased with him) that, “The Prophet (Allah bless him & give him peace) asked for water and a Jew gave him some, so the Prophet (Allah bless him & give him peace) said to him, ‘May Allah make you beautiful,’ so the man did not see grey hair till he died.”
As for after their death, it is impermissible (haram) to make dua for forgiveness and the like for a non-Muslim, for Allah Most High said, “It is not for the Prophet and those who believe to pray for the forgiveness of unbelievers even though they may be near of kin after it has become clear that they are people of hell-fire.” [Qur’an, 9: 113]