There are four drains on each corner of the sunroof. The hoses attached to them sometimes get disconnected,
so it is a good idea to double-check on them whenever you have the headliner out for example.
The hoses lead behind each fender/quarterpanel.
One way to test if they are clogged is to open the sunroof and slowly pour water in the jamb around it,
you should see the water drain behind the fenders.
If no/little water comes out, you can use compressed air to blow the dirt out.
Here you can (barely) see one of the draining tubes:
Then there are two drain holes on each side of the rain tray, see at the bottom left of the raintray:
These too get clogged with leaves/dirt - these are easier to clean, just remove the plastic raintray cover.