You can tell (with the larger fish) the females by checking the vent area and seeing a white dot there. That is the first egg. Males will not have that spot. Juv males will also have a more slender, elongated body than a similar aged fish.
But, as said before, females can be aggressive fish in their own rights. More often than not, if you look at a tank full of female Bettas in a store, they will be frayed and looking ragged. I used to cringe when my customer took my carefully, individually bagged females and tanked them together. In just minutes they would look like the loser of a prize fight. You need a lot of space to keep females together unless they are all sisters from the same spawn.
Hope this helps