Gerbil males have a distinctive bulge at the base of their tails. This is very obvious at four weeks old, which means you can easily tell the difference between males and females. Also, the two openings at the base of the animal's tail are close together in females, but much further apart in males.
Male or female?
Males and females kept together will mate when they are a mere three months old. For this reason, same-sex couples are the preferred option. Having said that, female Shaw's Jirds - one of the species of gerbil available as a pet in the US - are very territorial. This makes them aggressive, mainly towards other female gerbils. With that particular species, it is best to keep two males, or to have a separate cage ready in case fighting becomes a problem.