Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:2:189

They ask you, ˹O Muhammad˺, about the new moons. Say, "They are measurements of time for the people and for Hajj." And it is not righteousness to enter houses from the back, but righteousness is ˹in˺ one who fears Allah. And enter houses from their doors. And fear Allah that you may succeed.  

They will ask you, O Muhammad (s), about the new moons (ahilla, plural of hilāl): ‘Why do they seem very thin, and then wax until they are full of light, and then wane again as at the first, and are not always the same, in the way that the sun is?’ Say, to them: ‘They are appointed times (mawāqīt is the plural of mīqāt) for the people, for them to know the times for sowing the land, for business, for their women’s waiting periods, their fast and their breaking it, and the Pilgrimage’ (wa’l-hajji and the Pilgrimage’, is a supplement to li’l-nāsi, ‘for the people’), that is to say, ˹appointed times˺ by which its season is known, for if they ˹the new moons˺ always looked the same, none of these things could be known. It is not piety to come to the houses from their backs, in ˹your˺ state of pilgrimage inviolability (ihrām), when you would bore holes in them to enter them and then exit, disregarding their doors; they used to do this and claim that it was out of piety; but piety is to fear, God by not contravening His commands; so come to the houses by their doors, when in a state of pilgrimage inviolability, and fear God, that you may prosper, ˹that you may˺ triumph.
القرآن:٢:١٨٩

يَسْأَلُونَكَ عَنِ الْأَهِلَّةِ ۖ قُلْ هِيَ مَوَاقِيتُ لِلنَّاسِ وَالْحَجِّ ۗ وَلَيْسَ الْبِرُّ بِأَنْ تَأْتُوا الْبُيُوتَ مِنْ ظُهُورِهَا وَلَٰكِنَّ الْبِرَّ مَنِ اتَّقَىٰ ۗ وَأْتُوا الْبُيُوتَ مِنْ أَبْوَابِهَا ۚ وَاتَّقُوا اللَّهَ لَعَلَّكُمْ تُفْلِحُونَ  

{يسألونك} يا محمد {عن الأهلة} جمع هلال لمَ تبدو دقيقة ثم تزيد حتى تمتلئ نورا ثم تعود كما بدت ولا تكون على حالة واحدة كالشمس {قل} لهم {هي مواقيت} جمع ميقات {للناس} يعلمون بها أوقات زرعهم ومتاجرهم وعُدد نسائهم وصيامهم وإفطارهم {والحج} عطف على الناس أي يعلم بها وقته فلو استمرت على حالة لم يعرف ذلك {وليس البر بأن تأتوا البيوت من ظهورها} في الإحرام كغيره بأن تنقبوا فيها نقبا تدخلون منه وتخرجون وتتركوا الباب وكانوا يفعلون ذلك ويزعمونه برّا {ولكنَّ البرَّ} أي ذا البِر {من اتقى} الله بترك مخالفته {وأتوا البيوت من أبوابها} في الإحرام {واتقوا الله لعلكم تفلحون} تفوزون.

See similar narrations below:

Collected by Bukhārī
bukhari:4512ʿUbaydullāh b. Mūsá > Isrāʾīl > Abū Isḥāq > al-Barāʾ

In the Pre-lslamic Period when the people assumed Ihram, they would enter their houses from the back. So Allah revealed:-- "And it is not righteousness that you enter houses from the back, but the righteous man is he who fears Allah, obeys His Orders and keeps away from what He has forbidden. So enter houses through their doors." (2.189)  

البخاري:٤٥١٢حَدَّثَنَا عُبَيْدُ اللَّهِ بْنُ مُوسَى عَنْ إِسْرَائِيلَ عَنْ أَبِي إِسْحَاقَ عَنِ الْبَرَاءِ قَالَ

كَانُوا إِذَا أَحْرَمُوا فِي الْجَاهِلِيَّةِ أَتَوُا الْبَيْتَ مِنْ ظَهْرِهِ فَأَنْزَلَ اللَّهُ {وَلَيْسَ الْبِرُّ بِأَنْ تَأْتُوا الْبُيُوتَ مِنْ ظُهُورِهَا وَلَكِنَّ الْبِرَّ مَنِ اتَّقَى وَأْتُوا الْبُيُوتَ مِنْ أَبْوَابِهَا}