We were in the company of the Messenger of Allah (ﷺ) during a journey. The rain fell upon us. The Messenger of Allah (ﷺ) said: Anyone who wants to pray in his dwelling may pray.
Sunan Abi Dawud Book 2, Hadith 676