The females are the one's with the egg sacks hanging out of their back end.
They only have the eggs hanging out the back when they are stressed or there is a problem and they are aborting the attempt to reproduce. Those eggs die. When everything goes normally the eggs hatch as they leave the female's body so you won't actually see more than one or maybe 2-3 eggs at a time because they're hatching as quickly as they're coming out of the mother.
Generally a female won't have visible eggs of course, but you can sex them from the last instar in males and the last 2 instars in females (an instar is a stage between moults. They hatch at instar 1, moult into instar 2 and so on). They are basically impossible to sex until they are close to full size, then in one instar the males become adult males with wings and two pairs of organs at the hind end which look like small spikes or appendages. One pair is called the anal cerci, the other is called the styles/styli. Males have both. In the instar in which males become adults, female remain looking like the young woodies, except that they now lack one pair of those organs, they have the cerci but no style. These looks the same as the brown, wingless nymphs, but are about the size of the adult males. They then go through one extra instar and end up looking similar to the males except that they are larger, heavier/broader, and if you look closely, you can see they lack the pair of styles. You can generally tell at a glance because the males are smaller and more slender, but if you want to be sure you can take the close inspection.
Generally there's not much reason to sex them, unless you are super concerned about using your colony efficiently and feeding off males in preference, but you can only sex the larger ones anyway. If you want to breed them you'll want to start with at least a few dozen pairs, so just grab a pile and you'll have about half males and half females.
I just used to keep mine in a warm area of the herp room or anywhere when I've lived in warm climates. If you live in a warm enough climate you could keep them outdoors but I'd be concerned about various pathogens and parasites getting into them which can harm the herps which eat them. They don't need much space or make much noise or anything, so I've been happy to have them in the herp room. They're extremely easy and low maintenance and quite productive if you keep them warm (around 26-32 degrees). Too cool and they slow right down. Make sure they have plenty of ventilation but don't get too dry.