We set cut with the Messenger of Allah (ﷺ) on a journey when it began to rain. Upon this he said: He who desires may pray in his dwelling.
Sahih Muslim Book 6, Hadith 34