It is very very difficult for novice aquarists, and even for the more advanced ones. The only way to tell the difference is when they are ready to breed. The female has a fatter breeding tube.
The best way to get a pair is to get 6+ and let them pair off. You keep the pair(s) you feel is strongest. The rest either go back or to another tank.
HTH