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.
suyuti:2789a

The Prophet ﷺ said: When a man goes into his house, he should say: "O Allah! I ask Thee for good both when entering and when going out; in the name of Allah we have entered, and in the name of Allah we have gone out, and in Allah our Lord do we trust." He should then greet his family. (Using translation from Abū Dāʾūd 5096)   

السيوطي:٢٧٨٩a

"إِذَا وَلَجَ الرجلُ بيتَهُ، فليقل: الَّلهمَ إِنّى أسْألكَ خيرَ الموْلِجِ وخيرَ المخرجِ، بِسْم اللهِ وَلَجنَا، وبسْم اللهِ خرجْنا، وعلى اللهِ ربِّنا توكَّلنَا، ثُمَّ يسلِّمُ على نَفْسِه ".  

[د] أبو داود [طب] الطبرانى في الكبير عن أبي مالك الأشعرى

See similar narrations below:

Collected by Abū Dāwūd, Ṭabarānī
abudawud:5096Ibn ʿAwf > Muḥammad b. Ismāʿīl from my father

The Prophet ﷺ said: When a man goes into his house, he should say: "O Allah! I ask Thee for good both when entering and when going out; in the name of Allah we have entered, and in the name of Allah we have gone out, and in Allah our Lord do we trust." He should then greet his family.  

أبو داود:٥٠٩٦حَدَّثَنَا ابْنُ عَوْفٍ حَدَّثَنَا مُحَمَّدُ بْنُ إِسْمَاعِيلَ قَالَ حَدَّثَنِي أَبِي قَالَ ابْنُ عَوْفٍ وَرَأَيْتُ فِي أَصْلِ إِسْمَاعِيلَ قَالَ حَدَّثَنِي ضَمْضَمٌ عَنْ شُرَيْحٍ عَنْ أَبِي مَالِكٍ الأَشْعَرِيِّ قَالَ

قَالَ رَسُولُ اللَّهِ ﷺ إِذَا وَلَجَ الرَّجُلُ فِي بَيْتِهِ فَلْيَقُلِ اللَّهُمَّ إِنِّي أَسْأَلُكَ خَيْرَ الْمَوْلِجِ وَخَيْرَ الْمَخْرَجِ بِسْمِ اللَّهِ وَلَجْنَا وَبِسْمِ اللَّهِ خَرَجْنَا وَعَلَى اللَّهِ رَبِّنَا تَوَكَّلْنَا ثُمَّ لْيُسَلِّمْ عَلَى أَهْلِهِ  

tabarani:3452Hāshim > Muḥammad b. Ismāʿīl from my father > Ḍamḍam b. Zurʿah > Shurayḥ b. ʿUbayd > Abū Mālik

The Prophet ﷺ said: When a man goes into his house, he should say: "O Allah! I ask Thee for good both when entering and when going out; in the name of Allah we have entered, and in the name of Allah we have gone out, and in Allah our Lord do we trust." He should then greet his family. (Using translation from Abū Dāʾūd 5096)   

الطبراني:٣٤٥٢حَدَّثَنَا هَاشِمٌ ثنا مُحَمَّدُ بْنُ إِسْمَاعِيلَ حَدَّثَنِي أَبِي حَدَّثَنِي ضَمْضَمُ بْنُ زُرْعَةَ عَنْ شُرَيْحِ بْنِ عُبَيْدٍ عَنْ أَبِي مَالِكٍ قَالَ

كَانَ رَسُولُ اللهِ ﷺ يَقُولُ إِذَا وَلَجَ الرَّجُلُ بَيْتَهُ فَلْيَقُلْ اللهُمَّ إِنِّي أَسْأَلُكَ خَيْرَ الْمَوْلِجِ وَخَيْرَ الْمَخْرَجِ بِاسْمِ اللهِ وَلَجْنَا وَباسْمِ اللهِ خَرَجْنَا وَعَلَى اللهِ رَبِّنَا تَوَكَّلْنَا ثُمَّ يُسَلِّمُ عَلَى نَفْسِهِ