Abu Waqid reported,

While the Messenger of Allah ﷺ was in the mosque, three men came along. Two of them approached the Messenger of Allah ﷺ and one went away. One of the two saw a gap in the circle and sat down in it, while the other sat behind the group.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."

Bukhari 474

Sahih

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

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

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

البخاري 474صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Prayer
Chapter
Shaving and sitting in the masjid
Numbering
Darussalam 474
Bukhari 474