Ventilating combustion byproducts in water heaters
Rather than design something that offers danger of overheating, carbon monoxide poisoning, gas and over-pressure explosion, etc., why not use an off-the-shelf "instant" tankless water heater, available from sources such as Home Depot, Amazon or Lowes?

Find one certified for your area. Making your own is a tankless task!