Tree squirrels can be found in almost any land area on the planet, so they must be good at identifying each other's gender. If not, they would have a difficult time finding a mate to populate with. But getting close enough to identify the gender of a squirrel when you are a human, and less able to climb trees, could leave you scrambling for answers, as the squirrel almost mockingly in the distance scrambles for pine cones.
Check out the squirrel's genitals. This is clearly easier to do on a dead squirrel or a super tame one. This is the only absolute way to tell if the squirrel is a boy or girl. If the genital opening appears near the anus, it's a female. Boy squirrels have a scrotum sac, though you may not be able to see one on juveniles. On an excited adult, however, the scrotum might be obvious from afar. Teats might be noticeable from afar on a nursing female.
Observe the size of the squirrel. Generally, male squirrels are heftier than females. This is especially prominent in the African pygmy squirrel. This way of identifying becomes easier when there are several squirrels in a group.
Observe the behaviour of the squirrels. Male squirrels will often contend for the female, as happens often in nature. This behaviour is especially prominent in the East Asian red-bellied squirrel. If you see two or more squirrels chirping or fighting with each other and another squirrel is standing around and watching, the squabbling squirrels are likely the males.
Notice a squirrel looking after her young in a nest. Usually the female squirrel raises the babies, especially with the Douglas, also called chickarees, squirrel. Male squirrels, however, will put greater effort towards building the nest. A squirrel carrying an infant is likely a female.
In reference to Step 3: you may notice one squirrel chasing the other. One is usually male and the other female, but both chase after each other, so identifying the male and female this way is impossible.