Technical explanation: If you have two independent clauses combined by a coordinating conjunction (e.g., "so"), place a comma before the "so." If you are using "so" in the sense of "so that," it is a subordinating conjunction, not a coordinating conjunction, and should not be preceded by a comma.
Less technical explanation: If you use "so" in the sense of "therefore" to combine what could be two complete sentences, place a comma before it. Otherwise skip it.