And when you are greeted with a greeting, greet with a better (greeting) than it or return it; surely Allah takes account of all things.
According to this ayah and the Sunnah of the Prophet
(SAW), if a Muslim greets his brother he should return the greeting equally
which is an obligation on him, but it is recommended to say a better greeting
e.g. if a Muslims greets his brother by saying, Assalam-o-Alaikum (Peace be
upon you), he should return the greeting equally by repeating the same words
or greet him with a better greeting and say, Assalam-o-Alaikum-waRahmatullahi (Peace and Blessings be upon you). As far as the non-Muslims
are concerned, the Sunnah of the Prophet (SAW) clearly indicates that a Muslim
should not initiate the greeting with them, but if they greet the Muslims, then
they should return the greeting politely and respectfully without adding
anything to it. And “Certainly, Allah (SWT) is Ever a Careful Account Taker of all things.”
Allah (SWT) keeps count of all things.
Ahmad, Israr. (2012). Bayan ul Quran. 4-An-Nisa.pdf (islamicweblibrary.com)