There are generally three types of sentences (simple, compound, and complex sentences).
A simple sentence contains a subject and a verb. It expresses one idea or thought. Simple sentences may contain a compound subject and/or a compound verb.
John is driving. (subject – verb: There is one subject and one verb)
John is driving and texting. (subject – compound verb: There is one subject and two verbs)
John and Alex are walking. (compound subject-verb: There are two subjects and one verb)
John and Alex are walking and talking. (compound subject -compound verb: There are two subjects and two verbs)
Simple sentences do not usually have commas.
A compound sentence is made up of two independent clauses. These two independent clauses are combined or joined using a coordinating conjunction.
There are seven coordinating conjunctions
For And Nor But Or Yet So
A comma is sometimes used to join the two independent clauses and is inserted before the conjunction.
Sarah wanted to go swimming, but she hurt her ankle.
I was feeling thirsty, so I bought a drink from the shop.
The students were running and jumping all over the school field.
Linking two independent clauses
I like studying last minute before an exam, yet I know it is not a good idea.
A complex sentence has one independent clause and at least one dependent clause. A dependent clause contains a subject and a verb, but it can’t stand alone because it doesn’t include a complete idea or thought. It also begins with a subordinator. Examples of subordinators are: While, when, until, unless, if, since, because, even though, although, after, so that, like, as, whenever, before
Examples of complex sentences:
Alex wants to eat before playing football.
Before playing football, Alex wants to eat.
The concert was cancelled because there was a snowstorm.
Because there was a snowstorm, the concert was cancelled.
Note: The dependent clause is italicized. There is no comma if the independent clause is placed first.