The rule of thumb is 10 per gallon, but I've seen people go way over that. You just need a good filter, good oxygen-content in the water, and a sufficient amount of food. The most I've seen was 300-400 in a 10 gallon.
Adequate filtration is key - and some shrimps don't do very well with variable water conditions. It's sometimes difficult to keep water chemistry stable in a smaller tank, even with a relatively small bio load.
That said, I probably have 40-45 neos in a 4 gallon currently. I started with 5 in that tank a few months ago
As long as the filtration is good, you can go 1,000,000 per gallon. Lol. You get the point. They don't have much of a bioload soupy can load them up. Just keep up on water changes and they'll be fine. In my 37 gallon I have 16 cories and a bazillion cherry shrimp. I do a 50% water change every week and everyone is happy.