This is a large topic.
Rule 1: A comma is used to separate two independent clauses in a sentence. [My mother stayed home, and my father traveled to Europe.]
Rule 2: A comma is optional in a series: I like Pepsi, Coke (,) and Sprite.
I'll let others add rules 3 through 20 (whatever they are
).