Praise be to Allah.
The response to a greeting should be similar to it or better than it. Is it not the case that if the People of the Book greet us by saying “As-salaamu ‘alaykum (peace be upon you),” we should respond by saying “Wa ‘alaykum (and also upon you)”?
This means that we are praying for wellbeing for them, and what may be understood from that is that it is permissible to pray for worldly benefit for a disbeliever, so long as he is not openly hostile towards the Muslims.
This is in accordance with the verse in which Allah, may He be exalted, says (interpretation of the meaning):
“And when you are greeted with a greeting, greet [in return] with one better than it or [at least] return it [in a like manner]. Indeed, Allah is ever, over all things, an Accountant”
An-Nawawi (may Allah have mercy on him) said:
It should be understood that it is not permissible to pray for forgiveness for him and the like, which is not appropriate in the case of the disbeliever. But it is permissible to pray for his guidance, good health, well-being and so on.
End quote from al-Adhkaar (p. 317).
He also said:
Abu Sa‘d al-Mutawalli (one of the senior Shaafi‘i scholars, who died in 478 AH) said: If he wants to greet a dhimmi (non-Muslim living under Muslim rule) he should do so without saying as-salaamu ‘alaykum, such as saying “May Allah guide you” or “Good morning.”
I say: There is nothing wrong with what Abu Sa‘d said if there is a need for that. So he may say “Good morning” or say something to wish him happiness or wellbeing, or wish him a joyful morning.
And Allah knows best.
End quote from al-Adhkaar (p. 245)
Based on that, if a Jew or Christian says in his greeting “Kull sanah wa anta tayyib (every year may you be well)”, it seems that there is nothing wrong with responding in kind, such as saying, “Wa anta tayyib (lit. ‘and may you also be well’ – the traditional response to the greeting) and so on.
Moreover, in that regard the best thing is for the one who responds to intend thereby to pray that he be guided and attain the best state by giving up what he is following of false religion and by entering the religion of Allah.
Abu Dawood (5038) and at-Tirmidhi (2739) narrated that Abu Moosa said: The Jews used to (pretend to) sneeze in the presence of the Prophet (blessings and peace of Allah be upon him) hoping that he would say to them, “Yarhamukum Allah (may Allah have mercy on you,” but he used to say: “Yahdeekum Allahu wa yuslihu baalakum (may Allah guide you and set your affairs straight.”
Classed as saheeh by al-Albaani in Irwa’ al-Ghaleel (1277).
Ibn ‘Allaan (may Allah have mercy on him) said:
What appears to be the case is that they would pretend to sneeze by making a sound similar to sneezing, or they would make themselves sneeze by leaving their heads uncovered. They would do this in the presence of the Prophet (blessings and peace of Allah be upon him) in the hope that he would say to them “May Allah have mercy on you”, so that the blessing of his supplication would come to them, for in their hearts they knew that he was a Prophet and Messenger, even though outwardly they denied it out of envy and stubbornness.
“but he used to say” out of graciousness, and so as not to deprive them of the blessing of his presence and of sitting before him, “May Allah guide you” that is, may He cause you to follow the path of guidance, for if it be His will to cause you to be guided, you will believe and be guided.
“and set your affairs straight” i.e., with regard to that which was of concern to the Prophet (blessings and peace of Allah be upon him), namely religious matters, by guiding them to Islam, making it fair-seeming to them, and enabling them to embrace it.
End quote from Daleel al-Faaliheen (6/361). See also: Fath al-Baari by Ibn Hajar (10/604).
Ibn Muflih (may Allah have mercy on him) said: The author of al-Muheet, who was a Hanafi, said: If he intends in his heart to pray that Allah grant (the disbeliever) long life in the hope that he might become Muslim, there is nothing wrong with that. And if he says to a dhimmi “May Allah guide you”, that is good.
Ibraaheem al-Harbi said: Ahmad ibn Hanbal was asked whether a Muslim man may say to a Christian man, “May Allah honour you.” He said: Yes, he may say “May Allah honour you”, meaning: with Islam.
Similar to that is what was mentioned above about praying for him to have a long life, and that it is like praying for him to be guided.
End quote from al-Aadaab ash-Shar‘iyyah wa’l-Minah al-Mar‘iyyah (1/368).