Assalamualaikum ustaz. Is it permissible to perform jamak prayer when there is flooding in a certain area based on the hadith of the Prophet PBUH who performed jamak when it was raining? And can you explain the situation and conditions of jamak when it rains?
Alhamdulillah, praise and gratitude to Allah SWT for His countless blessings for us all. Praise and salutations to our beloved Prophet Muhammad PBUH, his family, companions and all those who follow his footsteps until the Last Day.
In the above issue, we are inclined to the opinion which states that it is impermissible to perform jamak during flooding. The reason is, usually flood victims are evacuated at temporary shelters such as public halls, schools and others. Gathering there would make it easy for them to perform the five obligatory prayers in congregation.
As for jamak when it rains, it is indeed warid from the Prophet PBUH and it is permissible in madhhab Syafie.  However, it must follow the conditions that have been set by the jurists:
- The jamak msut be jamak taqdim and not jamak takhir. It must be performed following the conditions of jamak taqdim which is that it begins with the initial prayer (Zohor or Maghrib) and one must set the intention to perform jamak in the first prayer, at the latest before the salam of the first prayer. 
- The second prayer (Asar or Isya’) must be performed in congregation at the mosque. It isn’t conditioned for the first prayer to be performed in congregation and it is permissible to be performed alone. When the imam declared to perform jamak prayer, then the whole congregants must perform jamak prayer even for those who live near the mosque following the incident of jamak prayer due to rain during the time of the Prophet PBUH, the Prophet PBUH himself acted as the imam even when his house is beside the mosque. 
- It must be performed at the mosque and not at home. The mosque or surau must be located far away that the rain will affect the people who are going to pray. If the house is near the mosque, then jamak is impermissible. 
- It is impermissible to jamak except when the rain wets the clothes, it is impermissible to jamak if it doesn’t harm or affect the clothes. Likewise, it is the same for snow, the rulings are the same as rain. 
May Allah SWT grant us all the love to pray the same as Rasullullah PBUH who said:
وَجُعِلَتْ قُرَّةُ عَيْنِي فِي الصَّلاَةِ
“And my comfort has been provided in prayer.”