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.
How to vent two bathroom fans through the roof.
This involves running ductwork from the fan usually though an attic and out through the roof.
You mount a switch in each bathroom.
To vent a bath fan through the roof you must first prepare a ductwork connecting the roof top to the bathroom.
Apply a bead of asphalt roof cement on the bottom of the vent.
Choosing a whole house fan.
A single exhaust exits through the roof figure a.
Through the roof depending on the location of the bathroom it may be easy to vent the exhaust fan through the roof.
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.
Center the nail between two rafters.
This setup requires an in line centrifugal fan mounted in the attic drawing air simultaneously from both bathrooms see photo.
The 2nd bathroom vent drips on the floor and is ruining the ceiling.
This system is quiet too.
In order to accomplish this the roof has to have a hole cut in it.
The lower half of the flange sits on top of the shingles.
Then drill a hole on the roof top.
Slide the vent under the shingles so they cover the top half of the vent flange.