Tankless water heaters don't need to be vented if they are electric. Gas-powered tankless water heaters do require ventilation because the gases they create are dangerous and flammable.
Just like standard water heaters, gas tankless water heaters generate combustion gases that contain carbon monoxide, which need to be vented. While electric tankless water heaters offer the advantage of not needing a vent, gas heaters are not hard to ventilate. Since 90 percent of the produced heat is used with a tankless water heater, very little is lost through the vent. The small amount of heat loss makes the gases warm and not hot, thus they can be vented right out the side of the house instead of through the roof.