Gail et al have clarified it well. There isn’t one set of rules, but the best way to be safe is to consult a dictionary. If you are writing an exam, say, and don’t have time or inclination to consult a dictionary, there are two good rules of thumb which almost always apply.
The first is a rule-of-thumb, that in many (not all) instances, the words have evolved from two words (out and side), to a new idea (outside) sometimes by way of hyphenation. Sometimes going straight to word, without. Again, in many cases, not all.
The second rule is to use hyphens when needed for clarity. The hyphen is needed, for instance, to distinguish re-sign from resign or re-creation from recreation. It also helps to differentiate a dirty-movie theater from a dirty movie-theater.
:-)