Unless very close to the meter (within 10 inches or one feet for example), tankless water heaters require dedicated gas lines to meet code.
Your plumber should perform a formal gas line sizing, but a key fact is that 3/4 gas line will carry 199,000 btu/hr (size of most tankless) for 30 feet. Any distance over that, say 31 will require one inch dedicated line to meet the Uniform Plumbing code.
Tankless water heaters require dedicated (not shared with the furnace, for example) 4, type III stainless steel fluing.
The fluing does not need to go to the roof, however; it can terminate just outside the wall with a stainless steel cap piece, which looks like a dryer vent cap. For vertical flue runs, a condensate T must be added to insure long life of the machine.
In confined spaces, such as closests, a DV model, such as the 751M-DV must be used.
It has a seperate intake air pipe where the combustion air is piped in from the attic, crawl space or outside.