The intent is to reduce the flow time before the hot water gets there to two gallons or less. This is part of why in “efficient” houses you install manifold pex systems, and use 3/8 to flow to the hot side of fixtures.
So, you can run 50-ft of 3/8-inch, or 43-ft of 1/2-inch.
If your designing Public buildings you need the heater in an adjacent mechanical room, or a return circulation loop. To stay at the five foot maximum.