The rule
Piping above ground has to be securely supported and placed where it's protected from physical damage. Outdoors it has to be elevated not less than 3-1/2 inches above the ground. Hangers are metal hooks, straps, bands, brackets or hangers (or building structure) rated for the pipe size, and the pipe can't be supported by other piping.
Where pipe passes through an exterior wall it has to be protected from corrosion with a coating or wrap and sealed around its circumference to keep out water, insects and rodents. If there's a protective sleeve, the spaces between the pipe and the sleeve and between the sleeve and the wall opening are sealed too.
Support spacing for steel pipe comes from Table 1210.3.5.1: 6 feet for 1/2 inch, 8 feet for 3/4 or 1 inch, and 10 feet for 1-1/4 inch or larger horizontal runs. Vertical 1-1/4 inch or larger pipe is supported at every floor level. CSST support follows the manufacturer's instructions.
A few other limits: for other than dry gas, slope the pipe not less than 1/4 inch in 15 feet so it doesn't trap; don't cut or notch a beam or joist without approval; don't run gas pipe through a clothes chute, chimney, gas vent, dumbwaiter, elevator shaft or air duct (with narrow exceptions); and keep valves out of the space above a dropped ceiling, other than required appliance shutoffs in spaces with vented appliances.
On the job
- Support the pipe close to the appliance. The code wants it anchored so the connection isn't carrying the strain, and the maximum spacing in the table is a ceiling, not a target.
- On an exterior penetration, use a sealing material compatible with the pipe and the sleeve. Caulk that attacks the coating is a repeat problem.
- Set outdoor pipe on supports so there's a clean gap under it. Pipe lying on soil or mulch rusts out.
- Don't borrow support from the water pipe or conduit next to it.
The inspector and your city's adopted edition have the final word.