This setup requires an in line centrifugal fan mounted in the attic drawing air simultaneously from both bathrooms see photo.
How to vent two bathroom fans through the roof.
The 2 pipes one a 4 master and the other a 3 2nd do not go through the ceiling but into a common box that goes through the roof.
Over there mount the vent hood using tri polymeric locking seal paste and put the nails to strengthen it.
Through the roof depending on the location of the bathroom it may be easy to vent the exhaust fan through the roof.
Then drill a hole on the roof top.
You mount a switch in each bathroom.
In order to accomplish this the roof has to have a hole cut in it.
Choosing a whole house fan.
This system is quiet too.
The lower half of the flange sits on top of the shingles.
Nail the lower corners with roofing nails and tar the heads.
A single exhaust exits through the roof figure a.
From inside the attic drive a nail through the roof directly above the bathroom vent fan.
The master bathroom and the 2nd bathroom vent through the roof and through the same opening.
To vent a bath fan through the roof you must first prepare a ductwork connecting the roof top to the bathroom.
This involves running ductwork from the fan usually though an attic and out through the roof.
The 2nd bathroom vent drips on the floor and is ruining the ceiling.
Slide the vent under the shingles so they cover the top half of the vent flange.