Stock is determined by a ton of factors but tank size is the most limiting. The “general rule” is 1” of fish per 5 gal but following that rule explicitly seems quite limiting to most aquarist. I feel new aquarist should stick to that rule closely and should only slightly exceed it once enough experience is gained.
Of course the other determining factors for stocking are the quality of filtration, pwc schedule, and the type of fish you get.
If you have a skimmer, 1.5+ lbs of lr per gal, and are performing 10+% pwc each week those things allow you to slightly exceed the “rule”.
By buying thinner longer fish like clowns, damsels, wrasse, gobies, ect… and not a fatter or messy eater also helps extend that rule slightly ie: not a puffer, trigger, lion, ect…
The use of a sump to extend total water volume also helps with keeping your nh3/no2/no3 in check.
Total length/height of the tank also has to be considered ie: a 55 gal tank gives you roughly 11”-14” of adult fish length but that doesn’t mean a Dog Face Puffer or Sailfin Tang which reach about that size should be attempted.
Main thing to take into consideration is that SW doesn’t exchange oxygen as well as FW does and greatly overstocking a tank will lead to suffocation if power is out longer then 4 hours. A generator or battery back up is highly recommended if slightly overstocking since all the filtration in the world is completely useless without power.