If the rain is affecting your WIFI signal it's because the rain is attenuating your signal due to the water in the air.
Rain can especially affect the WIFI signal If you are using a wireless connection such as a 2.4GHz band due to the interference.
Light rain shouldn't affect your WIFI though especially if you're connected to your own WIFI router inside your house but there can be a bit of interference when you have heavy rain and clouds.