Sayyiduna Abu Hurairah (may Allah be pleased with him) narrates: He learned of this statement of the Prophet Muhammad (peace and blessings be upon him): "When you go to a group of people sitting, greet them with salam. And when you get up (to leave), then (again) greet them with salam, because the first one does not have more right than the second one."
Hadith Referenceمسند الحميدي / 1196
Hadith Gradingمحدثین:إسناده حسن
Hadith Takhrij«إسناده حسن ، وأخرجه ابن حبان فى «صحيحه» برقم: 493، 494، 495، 496، والنسائي فى «الكبریٰ» برقم: 10102، 10128، 10129، 10130، 10131، وأبو داود فى «سننه» برقم: 5208، والترمذي فى «جامعه» برقم: 2706، وأحمد فى «مسنده» برقم: 7263، 7967، 9795، وأبو يعلى فى «مسنده» برقم: 6566، 6567»
Benefit: From this hadith, the importance of saying "as-salamu alaykum" becomes clear: when you enter a gathering, you should say "as-salamu alaykum," and when you leave, you should again say "as-salamu alaykum." Just as saying salam upon entering a gathering is a virtuous deed, likewise, saying salam when leaving the gathering is also a virtuous deed. One should not be negligent in saying salam at both of these times. Some people say salam when entering a gathering but do not say salam when leaving, which is not correct.
Source: Musnad al-Humaydi: Commentary by Muhammad Ibrahim bin Bashir, Page: 1194
´Narrated Abu Hurairah:` that the Messenger of Allah (ﷺ) said: "When one of you arrives at the gathering, then give the Salam, and if he is given a place to sit, then let him sit. Then when he stands, let him give the Salam, the first is more worthy than the last."
Shaykh Dr. Abdur Rahman Freywai
Explanation: 1: That is, both greetings (salams) hold equal importance and necessity. Just as one should offer salam upon joining a gathering, likewise, when departing from the gathering, one should also leave by offering a prayer of peace (salam) to everyone.
Source: Sunan al-Tirmidhi – Majlis ‘Ilmi Dar al-Da‘wah, New Delhi Edition, Page: 2706
Narrated Abu Hurairah: 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.
Shaykh Umar Farooq Saeedi
Benefits and Issues: It is obligatory to say salam both upon arriving at a gathering and upon returning. It is not the case that it is obligatory the first time but not required upon returning.
Source: Sunan Abu Dawood – Commentary by Shaykh Umar Farooq Saeedi, Page: 5208