To vent a bath fan through the roof you must first prepare a ductwork connecting the roof top to the bathroom.
How to vent two bathroom fans through the roof.
This setup requires an in line centrifugal fan mounted in the attic drawing air simultaneously from both bathrooms see photo.
From inside the attic drive a nail through the roof directly above the bathroom vent fan.
In order to accomplish this the roof has to have a hole cut in it.
Through the roof depending on the location of the bathroom it may be easy to vent the exhaust fan through the roof.
A grille in each bathroom attaches to ducts which then fasten to a y connector at the fan.
This system is quiet too.
The master bathroom and the 2nd bathroom vent through the roof and through the same opening.
The 2nd bathroom vent drips on the floor and is ruining the ceiling.
Center the nail between two rafters.
Apply a bead of asphalt roof cement on the bottom of the vent.
Over there mount the vent hood using tri polymeric locking seal paste and put the nails to strengthen it.
The lower half of the flange sits on top of the shingles.
Slide the vent under the shingles so they cover the top half of the vent flange.
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.
This involves running ductwork from the fan usually though an attic and out through the roof.
A single exhaust exits through the roof figure a.
You mount a switch in each bathroom.