Abu Waqid reported,

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

Bukhari 66

Sahih

حدثنا إسماعيل قال حدثني مالك عن إسحاق بن عبد الله بن أبي طلحة أن أبا مرة مولى عقيل بن أبي طالب أخبره

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

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

البخاري 66صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Knowledge
Chapter
Whoever sits where the gathering ends and whoever sees a gap in the circle and sits in it
Numbering
Darussalam 66
Bukhari 66