Let's start with a video!
Compound sentences are sentences that use conjunctions. Schoolhouse simplifies it a bit, because just as there are different types of pronouns there are also different types of conjunctions:
For our purposes, we'll take a look at the coordinating conjunctions: for, and, nor, but, or, yet, and so.
A compound sentence doesn't always have to, but oftentimes uses one of these coordinating conjunctions. For example:
I was awake all last night, and I was tired today.
In the above sentence you have two independent clauses. An independent clause must always have at least a subject and a verb. In the first half of the example sentence the subject is I and the verb is was awake. In the second half of the sentence the subject is I and the verb is was tired. The two independent clauses are separated by the conjunction and. Let's change up the sentence to see if it works the same with a different conjunction:
I was awake all last night, but I wasn't tired today.
Here, the two independent clauses are separated by the conjunction but.
Notice that before each conjunction there is a comma. That's the rule. When combining two independent clauses into a compound sentence the comma goes before the conjunction.