As others said, age of tank, filtration are keys.
But I also think layout of the tank, including the tank design itself. A 2g vase doesn't have much space when compared to a 2.5g tank even with them being very similar in size gallon wise.
Then add in real plants vs fake. what you plan to feed. your water, and WC schedule. your experience with shrimps. your feeding habits with them. and on and on.
there is no real correct answer. but always always always err on the side of caution and stock light. as others said, if they feel theres a need to populate, they most certainly will.
When I initially stock a shrimp tank, its 4 per gallon or less with standard tanks like a 10 gallon or 46 bow.