That rule has lots of variables and should only be used as a basic guide. You can have 100 fish in a 10gallon tank as long as they as compatible and the water quality is kept up to scratch.
I use 10gallon tanks to rear up rainbowfish. I keep a couple of hundred fry in them and as they grow I reduce the numbers to about 50 per tank. I do a 50% water change each day and keep a close eye on the water chemisty.
Other factors include the fish's height and body mass, and also how much they move around. A fish that is deep bodied like an angelfish, might only grow to 4 inches long but they end up the same height (not including fins). Having 2 full grown angelfish in a 10gallon tank just wouldn't work out well because they don't have enough room.
Having a 10inch oscar in the same tank wouldn't work either. It is only 10 inches of fish but it is just too big for that size tank.
Having 20 khuli loaches in the tank would be fine because they are skinny and peaceful. They also don't swim around a lot and as such they would be ok in a 10 gallon tank with some plants and rocks/ wood to hide under.
If you do a partial water change each day and you have really good filtration you can keep more fish in a small volume of water. But it means you have to do more work to keep the fish healthy. And if something goes wrong you lose a lot of fish very quickly.