It is narrated from Sayyiduna Abu Malik al-Ash'ari (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) used to say: "When a man enters his house, let him say: O Allah, I ask You for the best entering and the best exiting. In the name of Allah we enter, and in the name of Allah we leave, and upon Allah, our Lord, we rely. Then let him give the salam to himself."
Hadith Referenceالمعجم الكبير للطبراني / باب الحاء / 3439