As Salamu Alaykum respected Mufti,
Is it obligatory or recommended for a husband to warn his wife when he returns home? Or is he allowed to return unexpectedly without warning his wife? I am asking you this question in the case of a return of trip of a prolonged period and of a short absence, that is to say, 2 to 3 hours.
A person I know returned home unexpectedly and found his wife in bed with another man. The brother in question had been away for work and had to go home much earlier than usual. If one wanted to surprise his wife, can he not return home unexpectedly? What does the Shariah say about this? Are these rules apply to both men and women?
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيْم
In the name of Allah, the Most Gracious, the Most Merciful
Firstly, it is against Islam to spy on others, even your own spouse. Allah says, “O you who have believed, avoid much [negative] assumption. Indeed, some assumption is sin. And do not spy…” [Qur’an 49:12].
Secondly, announcing your presence when you return home is part of Islamic etiquette to avoid frightening the other person. Imam Ahmad ibn Hanbal said, “When a person enters his house, it is recommended that he makes some noise by coughing or tapping his shoes. Also, Bukhari and Muslim report that the Prophet denounced those people who unexpectedly surprise their families at night, whether returning from travel or otherwise because it makes them appear to be distrustful.
Only Allah knows best
Written by Maulana Mustafa Umar
Checked and approved by Mufti Mohammed Tosir Miah
Darul Ifta Birmingham
 Islamic Manners p. 8 by Shaykh Abdul Fattah Abu Ghuddah