Abu Waqid reported,

The Messenger of Allah ﷺ was once sitting in the mosque with people gathered around him when three men approached. Two of them came toward the Messenger of Allah ﷺ while the third walked away. When the two stood before the gathering of the Messenger of Allah ﷺ, they offered greetings of peace. One of them noticed a gap in the circle and sat down in it, while the other sat behind the group. The third had turned away and left.When the Messenger of Allah ﷺ finished, he said, "Shall I tell you about these three men? As for one of them, he sought refuge with Allah, so Allah gave him refuge. As for the second, he felt shy, so Allah was shy with him. As for the third, he turned away, so Allah turned away from him."

Azami 14284

Sahih

عن أبي واقد الليثي

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

الأعظمي 14284صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Superior moral conduct
Chapter
Etiquette of sitting and gatherings
Section
Whoever sits where the gathering ends, and whoever sees a gap in the circle and sits in it
Numbering
Jami al-Kamil 14284 (2nd edition)
Azami 14284