IF you have a sunroof, it’s common for the sunroof drains to clog.
Once the drains for the sunroof are clogged, and it rains, the water overfills the roof cavity, and poors into the car.
In the corner somewhere under the glass, should be a drain (one or two). To test whether it’s clogged, open the sunroof, and run water(slow rate) into the cavity between the roof and the inner aluminum headliner layer. IF the water starts filling up, then it’s clogged.
To clear the clog, locate the drain, and slowly/carefully put a metal hanger or solid wire in it to clear dirt build up.