Bara bin Azib reported,

This verse was revealed concerning us. The Ansar, when they performed Hajj and returned, would not enter their houses through the front doors but rather from the back. A man from the Ansar came and entered through his front door, and it was as if he was reproached for that. So the verse was revealed, "And it is not righteousness that you enter houses from the back, but righteousness is one who fears Allah. And enter houses through their doors" [Baqarah 2:189].

Bukhari 1803

Sahih

حدثنا أبو الوليد حدثنا شعبة عن أبي إسحاق قال سمعت

البراء رضي الله عنه يقول

نزلت هذه الآية فينا كانت الأنصار إذا حجوا فجاءوا لم يدخلوا من قبل أبواب بيوتهم ولكن من ظهورها فجاء رجل من الأنصار فدخل من قبل بابه فكأنه عير بذلك فنزلت {وليس البر بأن تأتوا البيوت من ظهورها ولكن البر من اتقى وأتوا البيوت من أبوابها}

البخاري 1803صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Umrah
Chapter
Saying of Allah the Exalted, "And enter the houses through their doors"
Numbering
Darussalam 1803
Bukhari 1803