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.
To vent a bath fan through the roof you must first prepare a ductwork connecting the roof top to the bathroom.
Center the nail between two rafters.
Through the roof depending on the location of the bathroom it may be easy to vent the exhaust fan through the roof.
Apply a bead of asphalt roof cement on the bottom of the vent.
You mount a switch in each bathroom.
In order to accomplish this the roof has to have a hole cut in it.
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.
Nail the lower corners with roofing nails and tar the heads.
From inside the attic drive a nail through the roof directly above the bathroom vent fan.
The lower half of the flange sits on top of the shingles.
A grille in each bathroom attaches to ducts which then fasten to a y connector at the fan.
Then drill a hole on the roof top.
This involves running ductwork from the fan usually though an attic and out through the roof.
This system is quiet too.
Slide the vent under the shingles so they cover the top half of the vent flange.
Over there mount the vent hood using tri polymeric locking seal paste and put the nails to strengthen it.