Ahmad narrated it (2/176–177).
I say: Its narrators are trustworthy, apart from Ibn Lahiʿah, whose memory was poor.
1323 — “When you leave your house, pray two units of prayer, which will protect you from an evil departure; and when you enter your house, pray two units of prayer, which will protect you from an evil entry.”
It was narrated by al-Mukhallis in his Hadith collection, as found in al-Muntaqa minhu (12/69/1); by al-Bazzar in al-Musnad (81); by al-Daylami in his Musnad (1/1/108)—see the addendum, no. 315/7—and by al-Hafiz ʿAbd al-Ghani al-Maqdisi in Akhbar al-Salah (67/1, 68/2), through several routes from Muʿadh ibn Fudalah, who said: Yahya ibn Ayyub al-Misri narrated to us, from Bakr ibn ʿAmr, from Safwan ibn Sulaym—Bakr said, “I believe [he narrated] from Abu Salamah”—from Abu Hurayrah, from the Prophet, peace and blessings be upon him, who said it. Al-Bazzar said: “We know of no narration from Abu Hurayrah except through this route.”
I say: This is a good chain of transmission. Its narrators are trustworthy and are among al-Bukhari’s narrators. There is only slight criticism concerning Yahya ibn Ayyub al-Misri, which is not harmful. Al-Haythami said in Zawaʾid al-Bazzar: “Its narrators have been declared trustworthy.” Al-Manawi said in al-Fayd: “Ibn Hajar said: ‘It is a good hadith; were it not for Bakr’s uncertainty, it would meet the criteria of an authentic hadith.’ Al-Haythami said: ‘Its narrators have been declared trustworthy.’” End quote. This shows how readily Ibn al-Jawzi judged it to be fabricated.