The 2 10 rule states that combustion vents should terminate at least 2 feet above any part of the roof within 10 feet.
Water heater vent height above roof.
The average being about 6 foot.
If it is a natural vent type water heater you can not vent it through the side wall it has to vent above the roof.
Exhaust gases are vented outdoors through a separate vent duct or through a separate chamber of the same pipe this requires a double wall vent duct.
Other issue is the bathroom installation which isn t permitted as well unless the water heater closet is sealed from the bathroom area air tight doors and it has a separate fresh air supply from exterior or other areas of the house that can be used for this purpose.
Here is the nfp11 codes.
All other gas vents shall terminate not less than 2 feet 610 mm above the highest point where they pass through the roof and at least 2 feet 610 mm higher than any portion of a building within 10 feet 3048 mm.
At the hottest point in a gas water heater flue the flue vent connector right above the heater top the temperature is not likely to rise above 350 degf.
Direct vent water heaters.
10 4 1 1 vents installed with mechanical exausters shall terminate not less than 12 in.
The difference is that a power vent water heater pulls in combustion air from the space around the appliance then uses a fan to propel the exhaust through the vent.
That would be 30 of rise above the roof at the roof plus the 24 if you.
Above the highest point where they pass through the roof surface.
It is reasonable to assume that higher in the flue temperatures are much lower.