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 went away. When the two stopped before the Messenger of Allah ﷺ, they greeted him with peace. One of them noticed a gap in the circle and sat down in it. The other sat behind the gathering. The third 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 toward him. As for the third, he turned away, so Allah turned away from him."
حدثنا الأنصاري حدثنا معن حدثنا مالك عن إسحق بن عبد الله بن أبي طلحة عن أبي مرة مولى عقيل بن أبي طالب
أن رسول الله ﷺ بينما هو جالس في المسجد والناس معه إذ أقبل ثلاثة نفر فأقبل اثنان إلى رسول الله ﷺ وذهب واحد فلما وقفا على رسول الله ﷺ سلما فأما أحدهما فرأى فرجة في الحلقة فجلس فيها وأما الآخر فجلس خلفهم وأما الآخر فأدبر ذاهبا فلما فرغ رسول الله ﷺ قال ألا أخبركم عن النفر الثلاثة أما أحدهم فأوى إلى الله فأواه الله وأما الآخر فاستحيا فاستحيا الله منه وأما الآخر فأعرض فأعرض الله عنه
Agreed upon [by Bukhari and Muslim]. Bukhari narrated it in the Book of Knowledge, chapter "Whoever sits wherever the gathering ends" etc., no. 66, and Muslim, no. 2176, both from the hadith of Malik through the same route, and it is found in Muwatta, 2/960, 961 (Yahya).