While the amount of water in your tank will have some bearing, it only effects the amount of oxygen by volume that is present in the water. That very basic stocking guideline that you quoted is not actually based so much on the actual gallons, but on what the typical aquarium of a particular size can handle. It does not take into account the atypical tank that is higher than it is long.
The number of fish that an aquarium tank can handle is more a function of how much surface area is available. This is important for the exchange of oxygen and other gases in the water. The larger the surface area, the faster that this exchange will take place. So a 20-gal high only supports as many fish as a 15-gal long and will not support as many fish as 20-gal long.
The amount of fish a tank can handle is known as the carrying capacity. The carrying capacity depends on several different factors:
1) The amount and type of filtration that is used.
----The more filtration that is used and the greater its efficiency, the higher the carrying capacity becomes.
2) The type of fish or other animals being kept and the space available to them.
----a) Some benefit the tank more than others by cleaning up waste and acting in concert with the biofilter. (Catfish)
----b) Some are heavier bodied and require more oxygen then slimmer fish will. (Serpae Tetra vs. Neon Tetra)
----c) Some produce much more waste and stress the biofilter more heavily. (Goldifsh)
----d) Some fish have a much higher activity level and will require more resources. (Danios and Bloodfins)
----e) High activity fish require more space then their size would normally indicate. (Danios and Bloodfins)
----f) Some fish are very territorial and will require more space than usual. (Cichlids)
----g) Some fish are aggressive and some passive. A number of hiding places may need to be available. Each fish will need its own area to patrol.
----h) Some fish (i.e. guppies) can handle crowding much better than others.
3) The food being fed to the fish.
----Meaty, frozen and live foods will stress the biofilter more than plant-based will.
4) Whether plants are present and the lighting used for them.
----Plants aid in the uptake of nitrates from the water and become part of the biofilter, but are dependent on the light they receive for growth and health.
5) The amount of aeration used.
----Aeration in the tank will increase the amount of gas exchanged at the tank's surface.
6) The area available for nitrifying bacteria to inhabit.
----This is affected by the substrate used, porous rock, filter materials and other surfaces.
7) Tank maintenance.
----How often you vacuum the tank and do PWC affects how many toxins that are present in the environment.
The guidelines normally given of 1" of fish per gallon of water are just that, guidelines. The factors above also need to be considered when stocking the tank. I personally have always based my stocking on the amount of surface area in the tank rather then the gallons in it.
You should also try to base your stocking on a tank that isn't using aeration or multiple filters. You don't want to depend on these means. If you do and there is a power outage, it won't take long for the evils of overcrowding to become evident.
In an overcrowded tank, the amount of oxygen available is less per fish, so the overcrowded fish don't grow as well and diseases will often afflict them. For example, for many fish in this situation, their bones will grow faster than their muscles and they become deformed. Some fish actually exude a growth limiting hormone that keeps the others from getting too large.
A good place to get simplified stocking numbers that are based on surface area is by going to this page:
Aquarium tank volumes, capacities and stocking levels - US
I know that this throws a lot of information into the mix, but these are factors that should be considered when stocking an aquarium.