IRC plumbing codes require a cleanout only every 100 feet for horizontal branches.
Where drain has a change in direction greater than 45 degrees, a cleanout is required within 40 feet.
Only underground cleanouts vertical cleanouts that extend to above grade or above floor level.
Cleanouts need to be accessible. If they are concealed you must provide an access of sufficient size to be able to remove the plug abd install a rodding system.
Cleanouts are not required where a fixture trap can be removed for cleaning or where the fixture itself has an integral trap can be removed for cleaning, like a water closet.
Perhaps most importantly, cleanouts need to be installed so that they allow cleaning of the drain in the direction of flow. This means one installs a cleanout on a wye and that the cleanout only cleans downstream of the location, not upstream.