A 20 gallon tank can carry a shoal or two of small fish plus a few bottom dwellers. There is no fixed count. Length, filtration and the species you pick set the limit, and the fish should go in stages. For the basics of building a plan, see how to stock a freshwater aquarium.
Start with a shoal
A shoal of small tetras or rasboras is a common core for a 20 gallon tank. Shoaling fish do best in groups of at least six, and a group of about eight to a dozen is a common plan for a long 20. For neon tetras in particular, the answer to “how many neon tetras in a tank” gives the group size to start from.
Length matters more than height
A long tank gives more surface area than a tall tank of the same volume, and it gives small community fish more room to swim side to side. For most community fish, a long 20 suits better than a tall one.
Add a few bottom dwellers
Bottom dwellers use a different part of the tank, so a few can join a shoal without crowding the middle water. Options for the lower level are covered in the guide on what fish live at bottom of aquarium. The question “do corydoras need sand substrate” matters if you are choosing between sand and gravel.
Gouramis and other territorial fish
Dwarf gouramis can be calm in the right setup, but males often fight, so one male per tank is the safer plan. Whether they get along depends on the rest of the stock. The question “are dwarf gouramis peaceful” has its own detailed answer.
Check species that outgrow the tank
Sources disagree on larger fish such as angelfish. Some say a pair fits a 20 gallon, and others say they outgrow it. Check the species and its adult size before you buy. The question “are angelfish good community fish” is covered in its own guide, which looks at how they fit a shared tank.
Filtration and water changes
A 20 gallon with a shoal and bottom dwellers needs a filter sized for the load and regular water changes. The guide on how often to change fish tank water sets a routine.
Add in stages
Add the shoal first, then the bottom dwellers, and let the water settle between batches. The guide on how many fish to add at once to new tank explains the batch sizes and the tests to run.
A 20 gallon can make a good community, provided the count stays modest and the water stays steady.