It is narrated from Sayyiduna Abu Umamah al-Bahili (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "Three kinds of people: whoever has even one of these qualities is under the guarantee of Allah. Whoever goes out in the path of Allah is under the guarantee of Allah: if He causes him to die, He will admit him to Paradise, and if He returns him to his family, he returns with whatever reward or spoils he has gained. And whoever is in the mosque is also under the guarantee of Allah: if He causes him to die, He will admit him to Paradise, and if He returns him to his family, he returns with whatever reward or spoils he has gained. And whoever enters his house with a greeting of peace is also under the guarantee of Allah, the Mighty and Majestic."
Hadith Referenceالمعجم الكبير للطبراني / باب الصاد / 7460