Abu Hurairah reported,

A man passed by the Messenger of Allah ﷺ while he was sitting in a gathering and said, "Peace be upon you."The Messenger of Allah ﷺ said, "Ten good deeds."Another man passed by and said, "Peace be upon you and the mercy of Allah."He said, "Twenty good deeds."Then another man passed by and said, "Peace be upon you and the mercy of Allah and His blessings."He said, "Thirty good deeds."Then a man rose from the gathering and left without giving the greeting of peace, so the Messenger of Allah ﷺ said, "How quickly your companion has forgotten! When one of you comes to a gathering, let him give the greeting of peace. Then if he wishes to sit, let him sit. And when he gets up to leave, let him give the greeting of peace, for the first is no more deserving than the last."

Azami 12904

Sahih

عن أبي هريرة

أن رجلا مر على رسول الله ﷺ وهو في مجلس، فقال: السلام عليكم. فقال: عشر حسنات. فمر رجل آخر، فقال: السلام عليكم ورحمة الله. فقال: عشرون حسنة. فمر رجل آخر، فقال: السلام عليكم ورحمة الله وبركاته. فقال: ثلاثون حسنة. فقام رجل من المجلس، ولم يسلم، فقال رسول الله ﷺ: ما أوشك ما نسي صاحبكم! إذا جاء أحدكم المجلس فليسلم، فإن بدا له أن يجلس، فليجلس، فإن قام فليسلم، فليست الأولى بأحق من الآخرة.

الأعظمي 12904صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Tafsir of the great Quran
Chapter
Tafsir of Surah Nur
Section
His saying, "The believers are only those who believe in Allah and His Messenger, and when they are with him on a matter of common interest, they do not leave until they have asked his permission. Those who ask your permission are those who believe in Allah and His Messenger. So when they ask your permission for some affair of theirs, give permission to whom you will among them, and ask forgiveness for them of Allah. Indeed, Allah is Forgiving, Merciful."
Numbering
Jami al-Kamil 12904 (2nd edition)
Azami 12904