Mishkat al-Masabih 2444
وَعَنْ أَبِي مَالِكٍ الْأَشْعَرِيِّ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: إِذَا وَلَجَ الرَّجُلُ بَيْتَهُ فَلْيَقُلْ: اللَّهُمَّ إِنِّي أَسْأَلُكَ خَيْرَ الْمَوْلِجِ وَخَيْرَ الْمَخْرَجِ بِسْمِ اللَّهِ وَلَجْنَا وَعَلَى اللَّهِ رَبِّنَا تَوَكَّلْنَا ثُمَّ لْيُسَلِّمْ عَلَى أَهْلِهِ . رَوَاهُ أَبُو دَاوُد
From Abu Malik al-Ashʿari, who said: The Messenger of Allah ﷺ said: "When a man enters his house, let him say: O Allah, I ask You for the good of the entering and the good of the leaving. In the name of Allah we have entered, and upon Allah our Lord we have relied. Then let him greet his family with salam." Reported by Abu Dawud.