He said, "Messenger of Allah, the floodwaters block the way between me and my people's mosque. I would love for you to come to me and pray in a spot in my house, so that I may take it as a place of prayer."The Messenger of Allah ﷺ replied, "We shall do so."When the Messenger of Allah ﷺ entered, he asked, "Ayn Tureed?"I pointed to a side of the house. The Messenger of Allah ﷺ stood up, we lined up behind him, and he led us in two units of prayer.
أخبرنا نصر بن علي قال أنبأنا عبد الأعلى قال حدثنا معمر عن الزهري عن محمود
أنه قال يا رسول الله إن السيول لتحول بيني وبين مسجد قومي فأحب أن تأتيني فتصلي في مكان من بيتي أتخذه مسجدا فقال رسول الله ﷺ سنفعل فلما دخل رسول الله ﷺ قال أين تريد فأشرت إلى ناحية من البيت فقام رسول الله ﷺ فصففنا خلفه فصلى بنا ركعتين
It was narrated by Muslim, Mosques, the chapter on the permission to stay away from congregational prayer for an excuse, hadith no. 33 onward... etc., hadith no. 657, from the hadith of Mamar. And Bukhari, Prayer, the chapter, "When he enters a house he prays wherever he wishes," hadith no. 424, from the hadith of Zuhri, through him. It is also found in Kubra, hadith no. 918.