how do you know when to put the apostrphe before the s, after the s, or to just no put one?
Apostrophes for possession work like this:
The apostrophe immediately follows the word being made possessive, so:
One girl owns a bicycle: It is the girl's bicycle. (It belongs to the girl.)
Several girls own bicycles: They are the girls' bicycles. (They belong to the girls.)
Two examples of 'just not putting one':
A dog wags its tail. (The only time its has an apostrophe is when it's a contraction of it is.
The bicycles are theirs. Their does not need an apostrophe for possession, because the word their is already possessive.
I hope this is helpful,