It is Mustahab to greet one another, but it is Wajib to reply the greeting.
It is Makruh to greet someone who is praying Salat.
If someone says Salam to one who is praying Salat, then the reply must be given exactly as it originally was worded; for example, if it is said: “Salamun Alaikum” then the reply must be given as: “Salamun Alaikum”, but if the greeting is: “Alaikum As – Salam” then according to IhtiyatWajib, the reply must be given as: “Salamun Alaikum”
It is not permissible for one who is reciting the Salat to say Salam to another person (to initiate it).
The reply to a Salam must be given immediately.
If two people say Salam to each other at the same time, then it is Wajib that both of them reply to the Salam of the other person.
Saying Salam to a non – Muslim is Makruh, but if the non – Muslim says Salam to a Muslim, then according to IhtiyatWajib, the reply must be given as “Alaikum” or one must only say “Salam”.