What gap from water heater to ceiling?
There should be minimum clearance specifications in the installation manual, so you should consult that. Anything else mentioned here is speculation.
You should shield the water heater from the shower spray.