I had the same problem before with losing my internet connection whenever it rained and it turned out that inside the telephone box outside my house the wires were corroded and causing a bad connection.
And then when it rained it seemed to short the connections out from the moisture that would get into the telephone box and I had the ISP come out and check it out and they fixed the connections and installed a new weather tight NID box since the old one was letting moisture inside.
After he fixed the wiring connections and changed out the NID telephone box on the side of my house the internet connection never drops anymore when it rains.