When joining two simple sentences into a compound sentence, you must insert a comma and a conjunction between the two simple sentences. You will always use a comma with the conjunctions for, nor, but, or, yet, so. However, the conjunction and can sometimes cause confusion.
Look at this sentence that contains the conjunction and:
Mary lost her keys and had to walk to school.
At first glance, it looks like a compound sentence and you might think you need to insert a comma.
However, this is not two sentences combined into one. There is only one subject, so this is a simple sentence. Only insert a comma with and when there are two complete sentences with two subjects doing action.
Here are more sentences that use and but are not really compound sentences. These sentences do not need a comma because they do not have two subjects doing something.
Bob rode his bike to school and stopped at my house along the way. Bob is the only subject. No comma.
Mom is leaving now and bringing the dog to the vet. Mom is the only subject. No comma.
Now look at these sentences. These are compound sentences with two subjects doing two things. You need a comma with and when the two simple sentences are joined into a compound sentence.
Bob rode his bike to school, and he stopped at my house along the way.
Bob is the first subject, and he is a second subject. Use a comma with the conjunction and.
Mom is bringing the dog to the vet, and I will meet her there.
Mom is the first subject, and I is the second subject. Use a comma with the conjunction and.
Always use a comma with the conjunction and when joining two simple sentences into a compound sentence. Check to be sure there are two subjects doing two things before adding the comma.
▶It’s your turn. Decide whether or not to use a comma with the conjunction and in this sentence. The sun is shining and I will ride my bike. Did you put a comma in front of and? Good for you!