Abu Malik al-Ash'ari reported God's messenger as saying that 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.
Anas reported God’s messenger as saying that when a man goes out of his house and says, "In the name of God; I trust in God; there is no might and no power but in God," the following will be said to him at that time, "You are guided, defended and protected." The devil will go far from him and another devil will say, "How can you deal with a man who has been guided, defended and protected?"
Abu Dawud transmitted it, and Tirmidhi transmitted up to “the devil will go far from him."
Abu Huraira said that when the Prophet congratulated* a man on his marriage he said, “God bless you, bless you both, and prosper your union.”
*The verb used is raffa'a which originally meant saying to someone who had just been married, "may the marriage produce close union and sons." It is said that because this was a phrase used in pre-lslamic times, the Prophet substituted for it the words used in this tradition. The verb thus develops simply the meaning of congratulating without in itself involving any particular formula.
Ahmad, Tirmidhi, Abu Dawud and Ibn Majah transmitted it.
Umm Salama told that when the Prophet went out of his house he said, “In the name of God; I trust in God; O God, we seek refuge in Thee from slipping, or straying, or causing injustice, or suffering injustice, or doing wrong, or having wrong done to us."
Ahmad, Tirmidhi and Nasa'i transmitted it, Tirmidhi saying this is a hasan sahih tradition, In the version of Abu Dawud and Ibn Majah, Umm Salama said that God’s messenger never went out of her house without raising his eye to the sky and saying, “O God, I seek refuge in Thee lest I stray or lead others stray,* or cause injustice, or suffer injustice, or do wrong, or have wrong done to me.”
*Some read as above, but others read 'or be led astray'.