(The salutation of "Salaam" to the Muslim when first greeting and when departing)
According to Quran and Sunnah
It is a recommended sunnah (way, tradition) to greet the muslim; it is fard (obligatory) to reply.
Exceptions are that women are not expected to have to speak to non-mahram men.
The generally expected greeting is "As sala'amu alaikum" (peace be upon you) and the generally expected reply is "walaikum as sala'am" (and unto you also, peace).
Adding "wa rahmatullahi" (and mercy) and/or "wa barakatuhu" (and blessings) is a commendable act. If someone adds mercy and/or blessings in their salaams to you, you should reply with the same or add more goodness to it (i.e. if someone says "As sala'amu alaikum wa rahmatullahi", you should reply with "As sala'amu alaikum wa rahmatullahi" or also add "wa barakatuhu".
The Order to Greet
The Noble Qur'an An-Nur 24:61
...when you enter the houses, greet one another with a greeting from Allâh (i.e. say: As-Salâmu 'Alaikum - peace be on you) blessed and good. Thus Allâh makes clear the Ayât (these Verses or your religious symbols and signs, etc.) to you that you may understand.
The Noble Qur'an An-Nisa 4:86
When you are greeted with a greeting, greet in return with what is better than it, or (at least) return it equally. Certainly, Allâh is Ever a Careful Account Taker of all things.
Ibn Katheer raheemahullaah explained this verse by saying: "If the person greeted you with the Salaam you should reply in a better form, or reply similarly. However, the extended form is preferable, but the shorter is compulsory. Which means that greeting is preferable but the greeting in return is compulsory, and it should be in the form of the Salaam and not in any other form."
Hadith - Sahih Bukhari 4.543, Narrated Abu Huraira, r.a.
The Prophet said, "Allah created Adam, making him 60 cubits tall. When He created him, He said to him, "Go and greet that group of angels, and listen to their reply, for it will be your greeting (salutation) and the greeting (salutation) of your offspring." So, Adam said (to the angels), As-Salamu Alaikum (i.e. Peace be upon you). The angels said, "As-salamu Alaika wa Rahmatu-l-lahi" (i.e. Peace and Allah's Mercy be upon you). Thus the angels added to Adam's salutation the expression, 'Wa Rahmatu-l-lahi.' Any person who will enter Paradise will resemble Adam (in appearance and figure). People have been decreasing in stature since Adam's creation.
The Noble Qur'an Al-An'am 6:54
When those who believe in Our Ayât (proofs, evidences, verses, lessons, signs, revelations, etc.) come to you, say: "Salâmun 'Alaikum" (peace be on you); your Lord has written Mercy for Himself, so that, if any of you does evil in ignorance, and thereafter repents and does righteous good deeds (by obeying Allâh), then surely, He is Oft*Forgiving, Most Merciful.
Hadith - Sahih Muslim 96, Narrated Abu Hurayrah
The Messenger of Allah, observed: You shall not enter paradise so long as you do not affirm belief (in all those things which are the articles of faith) and you will not believe as long as you do not love one another. Should I not direct you to a thing which, if you do, will foster love amongst you: (i.e.) give currency to (the practice of paying salutation to one another by saying) as-salamu alaykum.
Hadith - Sahih Bukhari 8.251, Narrated Abu Hurayrah
Allah's Apostle said, "The riding one should greet the walking one, and the walking one should greet the sitting one, and the small number of persons should greet the large number of persons."
Hadith - Malik's Muwatta Book 53, Number 53.1.1
Yahya related to me from Malik from Zayd ibn Aslam that the Messenger of Allah, said, "The one riding greets the one walking, and when one of a group of people gives a greeting, it is enough for all of them."
The person coming or going, should first offer the salutation (salaams):
Hadith - Abu Dawood 5189, Narrated Abu Hurayrah
The Prophet said: When one of you comes to an assembly, he should give a salutation and if he feels inclined to get up, he should give a salutation, for the former is not more of a duty than the latter.
The pious muslims is anxious to give salaams first
Hadith - Abu Dawood 5178, Narrated Abu Umamah
The Prophet said: Those who are nearest to Allah are they who are first to give a salutation.
Hadith - Al-Tirmidhi #991, Narrated Abdullah ibn Umar, Transmitted by Tirmidhi.
I asked Bilal: How did Allah's Apostle respond to them as they greeted him while he was in prayer? Thereupon he said: He only made a gesture with his hands (in order to respond to the greeting).
Hadith - Sunan of Abu Dawood 927, Narrated Abdullah ibn Umar
The Apostle of Allah went to Quba to offer prayer. Then the Ansar (the Helpers) came to him and gave him a salutation while he was engaged in prayer. I asked Bilal: How did you find the Apostle of Allah responding to them when they gave him a salutation while he was engaged in prayer. He replied: In this way, and Ja'far ibn Awn demonstrated by spreading his palm, and keeping its inner side below and its back side above.
Hadith - Abu Dawood 924, Narrated Abdullah ibn Mas'ud
We used to salute during prayer and talk about our needs. I came to the Apostle of Allah and found him praying. I saluted him, but he did not respond to me. I recalled what happened to me in the past and in the present. When the Apostle of Allah finished his prayer, he said to me: Allah, the Almighty, creates new command as He wishes, and Allah, the Exalted, has sent a fresh command that you must not talk during prayer. He then returned my salutation.
Hadith - Bukhari and Muslim
Ibn Mas'ud reports: "We used to greet the Messenger of Allah while he was in salah and he would respond to our greeting. When we returned from Abyssinia, we greeted him [during prayer] but he did not respond to our salutation. We said to him: 'O Messenger of Allah, we used to greet you while you were in salah and you used to respond to us!' He then said: 'Prayer demands one's complete attention.'"
Do not wave like Christians or use fingers like Jews
Hadith - Al-Tirmidhi 4649, Narrated Abdullah ibn Amr ibn al-'As
Allah's Messenger said, "He does not belong to us who imitates other people. Do not imitate the Jews or the Christians, for the Jews' salutation is to make a gesture with the fingers and the Christians' salutation is to make a gesture with the palms of the hands."
[Tirmidhi transmitted it, saying its isnad is weak]
Salaams while urinating?
Hadith - Abu Dawood 17, Narrated Mahajir ibn Qunfudh
Muhajir came to the Prophet while he was urinating. He saluted him. The Prophet did not return the salutation to him until he performed ablution. He then apologised to him, saying: I disliked remembering Allah except in the state of purification.
Hadith - Sahih Muslim 721, Narrated Abdullah ibn Umar, r.a.
A person happened to pass by the Messenger of Allah when he was making water and saluted him, but he did not respond to his salutation.
Salaams to animals?
Hadith - Malik's Muwatta Book 56, Number 56.1.4
Malik related to me from Yahya ibn Said that Isa ibn Maryam [Jesus, r.a.] encountered a pig on the road. He said to it, "Go in peace." Somebody asked, "Do you say this to a pig?" Isa (r.a.) said, "I fear lest I accustom my tongue to evil speech."
Greeting muslims with something other than salaam
The Noble Qur'an Al-Mujadilah 58:8
Have you not seen those who were forbidden to hold secret counsels, and afterwards returned to that which they had been forbidden, and conspired together for sin and wrong doing and disobedience to the Messenger (Muhammad SAW). And when they come to you, they greet you with a greeting wherewith Allâh greets you not, and say within themselves: "Why should Allâh punish us not for what we say?" Hell will be sufficient for them, they will burn therein, and worst indeed is that destination!
Hadith - Al-Tabarani
If someone begins speaking before making the greetings, he should not be responded to until he gives the proper greetings.
Men Greeting Women
Hadith - Malik's Muwatta Book 53, Number 53.1.2
Yahya related to me from Malik from Wahb ibn Kaysan that Muhammad ibn Amr ibn Ata said, "I was sitting with Abdullah ibn Abbas when a Yemeni man came in. He said, 'Peace be upon you, and the mercy of Allah and His blessing' (as-salamu alaykum wa rahmatullahi wa barakatuhu), and then he added something more to that. Ibn Abbas said (and at that time his eyesight had gone), 'Who is this?' People said, 'This is a Yemeni who has come to see you,' and they introduced him. Ibn Abbas said, 'The greeting ends with the word blessing.' "
Yahya said that Malik was asked, "Does one greet a woman?" He said, "As for an old woman, I do not disapprove of it. As for a young woman, I do not like it."
Greeting Jews and Christians
Hadith - Sahih Bukhari Book 25, Number 5389, Narrated AbuHurayrah
Allah's Messenger said: Do not greet the Jews and the Christians before they greet you and when you meet any one of them on the roads force him to go to the narrowest part of it.
Hadith - Malik's Muwatta Book 53, Number 53.2.3
Yahya related to me from Malik from Abdullah ibn Dinar that Abdullah ibn Umar said that the Messenger of Allah said, "When a jew greets you, and says 'Death to you' (as-samu alaykum) say, 'And to you.' "
Yahya said, "Malik was asked whether a person who greeted a jew or christian, should apologise for it. He said, 'No'."
From Jaabir Ibn Abdullaah who said: "Men from amongst the Jews greeted the messenger of Allaah . So they said: 'As-Saam Alay Kum (May death be upon you) o Aba-al-Qaasim.' So he said, 'And unto you' (Wa Alay Kum). So Aa'ishah(r) became angry, and she said, 'Did you not hear what they said!?!' So he said, 'Indeed, and I returned it on them, and verily we answer them, and they don't answer us.'"
[Saheeh Muslim 5/7 of the Arabic. Shaykh Al Albaanee cites it in Mukhtasar Saheeh Muslim no. 1433, p. 672.]
It is worthy to note that scholars such as Imaam Muslim considered this reply to be general, and not to be specific to the situation mentioned.
Sitting in a Circle to Join the Believers
Hadith - Malik's Muwatta Book 53, Number 53.3.4
Yahya related to me from Malik from Ishaq ibn Abdullah ibn Abi Talha from Abu Murra, the mawla of Aqil ibn Abi Talib from Abu Waqid al-Laythi that the Messenger of Allah, may Allah bless him and grant him peace, was sitting in the mosque with some people when three people came in. Two came toward the Messenger of Allah and one went away. When the two stopped at the assembly of the Messenger of Allah, they gave the greeting. One of them saw a gap in the circle and sat in it. The other sat down behind the circle. The third turned away and left. When the Messenger of Allah finished, he said, "Shall I tell you about three people? One of them sought shelter with Allah, so Allah gave him shelter. The other was shy, so Allah was shy to him. The other turned away, so Allah turned away from him."
Hadith - Muwatta 55.2
Malik related to me from Muhammad ibn al-Munkadir that Umayma bint Ruqayqa said, "I went to the Messenger of Allah with the women who took an oath of allegiance with him in Islam. They said, 'Messenger of Allah! We take a pledge with you not to associate anything with Allah, not to steal, not to commit adultery, not to kill our children, nor to produce any lie that we have devised between our hands and feet, and not to disobey you in what is known.' The Messenger of Allah said, 'In what you can do and are able.' "
Umayma continued, "They said, 'Allah and His Messenger are more merciful to us than ourselves. Come, let us give our hands to you, Messenger of Allah!' The Messenger of Allah said, 'I do not shake hands with women. My word to a hundred women is like my word to one woman.' "
Hadith - Abu Dawood, Narrated Al-Bara' ibn Azib
The Prophet said: If two Muslims meet, shake hands, praise Allah, and ask Him for forgiveness, they will be forgiven.
Not Replying to Salaams
Hadith - Al-Tirmidhi 41, Narrated Uthman ibn Affan
When the Prophet died, some of his companions were so much aggrieved (at his death) that they were disposed to doubts. Uthman said: I was one of them. While I was sitting there happened to pass by me Umar and he offered me salutation which I did not notice. Umar made a complaint of that to AbuBakr. Then both of them came and offered me salutation and
AbuBakr said: What prompted you to ignore the salutation of your brother, Umar.
I said: I never did that.
Umar said: By Allah, of course you did that.
I said: By Allah I did not perceive that you passed by me and paid salutation.
AbuBakr said: Uthman is speaking the truth and something must have absorbed your mind (that you did not take notice of this matter).
I said: Yes it is so.
He said: What is that?
I said: Allah has taken away His Prophet SAAWS before we asked him how we could free ourselves from the snares of the world and the devil.
AbuBakr said: I did ask about that.
So I got near to him and said to him: May my father and mother be taken as ransom for you and you were the worthiest to ask.
Thereupon AbuBakr said: I said to Allah's Messenger (peace be upon him), how one could free oneself from the snares of the world and devil.
Thereupon Allah's Messenger (peace be upon him) said: He who accepted from me the word that I presented to my uncle which he rejected is the freedom (from them) (Affirmation of the oneness of Allah and the Apostlehood of Muhammad).
[Transmitted by Ahmad]
Hadith - Al-Tirmidhi 4249, Narrated Anas ibn Malik
Anas or someone else told that Allah's Messenger asked permission to enter the house of Sa'd ibn Ubadah saying, "Peace and Allah's mercy be upon you." Sa'd replied, "And upon you be peace and Allah's mercy," but did not speak loud enough for the Prophet to hear. He gave the salutation three times and Sa'd responded three times, but did not speak loud enough for him to hear, so the Prophet (peace be upon him) went away. Sa'd went after him and said, "Messenger of Allah, for whom I would give my father and mother as ransom, you did not give a salutation without my hearing it and responding to you, but I did not speak loud enough for you to hear because I wanted to receive many of your salutations and so receive great blessing." They then entered the house and he offered him raisins which Allah's Messenger ate. Then when he finished he said, "May the righteous eat your food, may the angels invoke blessings on you, and may those who have been fasting break their fast with you!"
It is transmitted in Sharh as-Sunnah.
End a Three Day Dispute with Salaams
Hadith - Sunan of Abu Dawood 4894, Narrated Abu Hurayrah
The Prophet said: It is not allowable for a believer to keep from a believer for more than three days. If three days pass, he should meet him and give him a salutation, and if he replies to it they will both have shared in the reward; but if he does not reply he will bear his sin (according to Ahmad's version) and the one who gives the salutation will have come forth from the sin of keeping apart.
Greeting All in a Muslim Region
Hadith - Malik's Muwatta Book 53, Number 53.3.6
Yahya related to me from Malik from Ishaq ibn Abdullah ibn Abi Talha that at-Tufayl ibn Ubayy ibn Kab told him that he visited Abdullah ibn Umar one morning and went out with him to the market, and when they were out, Abdullah ibn Umar did not pass by anyone selling poor merchandise or selling commodities or a needy person or anyone but that he greeted them.
At-Tufayl said, "I came to Abdullah ibn Umar one day and he asked me to follow him to the market. I said to him, 'What will you do in the market if you will not stop to sell nor seek any goods or barter with them or sit in any of the assemblies or market?' Abdullah ibn Umar said that we should sit down and talk, and then he explained, 'Abu Batni, (lit. father of the belly, at-Tufayl had a prominent stomach), we go out in the morning only for the sake of the greeting. We greet whomever we meet.' "
Greeting During a Khutba (Friday Sermon)
One should not speak during the khutbah.
Hadith - Al-Muwatta 5.8
Yahya related to me from Malik from Abu'n Nadr, the mawla of Umar ibn Ubaydullah, from Malik ibn Abi Amir that Uthman ibn Affan used to say in khutbas, and he would seldom omit it if he was giving the khutba, "When the imam stands delivering the khutba on the day of jumua, listen and pay attention, for there is the same portion for someone who pays attention but cannot hear as for someone who pays attention and hears. And when the iqama of the prayer is called, straighten your rows and make your shoulders adjacent to each other, because the straightening of the rows is part of the completion of the prayer." Then he would not say the takbir until some men who had been entrusted with straightening the rows came and told him that they were straight. Then he would say the takbir.
Hadith - Bukhari's Book of Manners #1046
Abu Huraira, r.a., said, "The most miserly of all people is one who is miserly with greetings. The weakest of all people is a person who is weak in [making] du'a (supplication prayer).".
Greeting during Eid*
It is permissible for Muslims to greet each other on the day of Eid with specific greetings that have been reported from the sahabah (ra). Responding to a question in this regard, Ibn Taymiyyah (r) said:
"As for people greeting each other after the eid prayer by, 'Taqaballahu minna wa mimkum' (may Allah accept from us and you) - it is reported that some of the shahabah practiced it, and the scholars permitted it. However, Ahmad said, 'I do not initiate saying it to anyone; but if one says it to me, I answer him. This is because responding to a greeting is obligatory, but to initiate the greeting is not a required sunnah, neither is it prohibited: whoever does it it would have an example (from the salaf) and whoever does not would have a predecessor as well." (Al Fatawi 24:253)
Jabyr ibn Nufayr said: 'When the companions of Allah's Messenger (saaws) met on the day of eid, they would say to each other, 'Taqaballahu minna wa mink (may Allah accept from us and you)." [Al Mahamiliyyat; hasan isnad; see Fath ul Bari 2:446]
And Muhammad ibn Ziyad said: I was with Abu Umamah al Bahili (ra) and some other companions of the Prophet (saws). When they returned from the eid, they said to each other, 'Taqabbalallahu minna wa mink."
*taken from "Celebrations in Islam", compiled by Muhammad al Jibali.