The Messenger of Allah ﷺ was 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 went away. When the two stood before the gathering of the Messenger of Allah ﷺ, they greeted him. One of them saw a gap in the circle and sat in it, the other sat behind the group, and 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 shy with him. As for the third, he turned away, so Allah turned away from him."
أن رسول الله ﷺ بينما هو جالس في المسجد والناس معه إذ أقبل نفر ثلاثة، فأقبل اثنان إلى رسول الله ﷺ، وذهب واحد، فلما وقفا على مجلس رسول الله ﷺ سلما، فأما أحدهما فرأى فرجة في الحلقة فجلس فيها، وأما الآخر فجلس خلفهم، وأما الثالث فأدبر ذاهبا، فلما فرغ رسول الله ﷺ قال: ألا أخبركم عن النفر الثلاثة؟ أما أحدهم فآوى إلى الله فآواه الله، وأما الآخر فاستحيا فاستحيا الله منه، وأما الآخر فأعرض فأعرض الله عنه.
Malik narrated it in Muwatta, in the chapter on greetings (4), from Ishaq bin Abdullah bin Abu Talha, from Abu Mura, the freed slave of Aqeel bin Abu Talib, from Abu Waqid Laythi, and he related it.Bukhari narrated it in the chapter on knowledge (66) from Ismail, and Muslim narrated it in the chapter on greetings (2176) from Qutayba bin Saeed, both of them from Malik.