It is narrated from Sayyiduna Abu Hurairah (may Allah be pleased with him) that the Prophet (peace and blessings of Allah be upon him) said: "When any of you comes to a gathering, he should greet with salam. If he sits down and then has to get up and leave before the gathering disperses, he should greet with salam, for the first salam is not more important than the second."
Hadith Referenceالادب المفرد / كتاب السلام / 1008
Hadith Gradingالألبانی:صحيح
Hadith Takhrij«صحيح : سنن أبى داؤد ، الأدب ، ح : 5208 و جامع الترمذي ، ح : 2706»
Explanation & Benefits
Shaykh Maulana Usman Muneeb
Benefits and Issues: When a person comes to a gathering and then quickly gets up and leaves, it can cause concern among the people present, as they may wonder why this person came and then silently left. For this reason, it is commanded to offer greetings (salam) both upon entering and leaving.
Source: Fadlullah al-Ahad: Urdu Commentary on al-Adab al-Mufrad, Page: 1008