The Messenger of Allah ﷺ said, "There are three whom Allah guarantees. A man who goes out as a warrior in the path of Allah is guaranteed by Allah, who will either take his soul and admit him into Paradise, or return him with whatever reward and spoils he has gained. A man who goes to the mosque is guaranteed by Allah, who will either take his soul and admit him into Paradise, or return him with whatever reward and spoils he has gained. And a man who enters his house with peace is guaranteed by Allah
."
حدثنا عبد السلام بن عتيق حدثنا أبو مسهر حدثنا إسمعيل بن عبد الله يعني ابن سماعة حدثنا الأوزاعي حدثني سليمان بن حبيب
عن رسول الله ﷺ قال ثلاثة كلهم ضامن على الله عز وجل رجل خرج غازيا في سبيل الله فهو ضامن على الله حتى يتوفاه فيدخله الجنة أو يرده بما نال من أجر وغنيمة ورجل راح إلى المسجد فهو ضامن على الله حتى يتوفاه فيدخله الجنة أو يرده بما نال من أجر وغنيمة ورجل دخل بيته بسلام فهو ضامن على الله عز وجل
Takhrij, its isnad is sahih. Bukhari narrated it in Adab al-Mufrad, no. 1094, from the hadith of Abu Mushir with this wording, and Hakim graded it sahih in 2/73, 74, and Dhahabi agreed with him.