وَعَنْ أَبِي مَالِكٍ الْأَشْعَرِيِّ
قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «إِذَا وَلَجَ الرَّجُلُ بَيْتَهُ فَلْيَقُلْ: اللَّهُمَّ إِنِّي أَسْأَلُكَ خَيْرَ الْمَوْلِجِ وَخَيْرَ الْمَخْرَجِ بِسْمِ اللَّهِ وَلَجْنَا وَعَلَى اللَّهِ رَبِّنَا تَوَكَّلْنَا ثُمَّ لْيُسَلِّمْ عَلَى أَهْلِهِ»
The Prophet (sallallahu alayhi wa sallam) said: when a man goes into his house he should say, “O God, I ask Thee for good both when entering and when going out; in the name of God we have entered and in God our Lord do we trust.” He should then greet his family.