You can't do that in a pet shop, the best thing you can do is to buy them in bunches and hope that some will be females

They're usually too young to determine gender when sold.
But if you want to try, you could look at their vent, on females it's round and slightly protruding, while on males it's more like an oval.
Later on when they'll be in breeding mood, the males will develop breeding tubercles, that look like white little pimples on their gill covers and front ray of the pectoral fin, while females will fill up with eggs and get rounder around her belly.