The American Gerbil Society recommends a minimum of 10 US gallons for 1 to 2 gerbils, and 1 extra gerbil per 5 extra US gallons after that.
However, I'd go for a minimum of 20 US gallons for 1 to 2 gerbils, and preferably an extra 10 US gallons for each gerbil after that. Pretty much like Elliriyanna said In a 30 gallon tank I'd say 4 maximum, for a 40 I'd say 5 maximum. Bigger is always better though!
If you think that's bad, I have a hamster book that says 10 US Gallons is okay for 4 adult dwarf hamsters!
Europeans have higher recommendations, of course. One dutch site says 15 US Gallons for 1 or 2 gerbils, 30 US Gallons for 4 to 8 gerbils. Another dutch site says 15 US Gallons for 1 to 2 gerbils, and an extra 5 US Gallons per extra gerbil. In Austria, a tank for gerbils has to be 50 US Gallons minimum by law. And Germany recommends 65 US Gallons.