All clauses have subjects and predicates. The subject is who or what does the action, and the predicate is that action. A complete sentence is also known as an independent clause. It must express a complete thought. It must be able to stand alone in meaning.
Example: The boy shopped for new video games.
"The boy" is the subject or who did the action.
"shopped for video games" is the predicate or what action the boy did.
This sentence carries meaning and can stand alone.
A compound sentence has two independent clauses. In other words it has two COMPLETE sentences attached to one another usually by a conjunction.
Example: The boy shopped for video games, but his brother looked at vintage comic books.
There are TWO independent clauses or sentences here.
The boy shopped for video games.
His brother looked at vintage comic books.
They are connected by the conjunction "but"
Be careful that you do not confuse this with compound subjects or compound predicates.
Example: The boy and his brother went shopping together.
In this case you still have a simple sentence with a compound subject: the boy and his brother
Example: The boys went shopping and perused video games and vintage comic books.
This has a compound predicate--- two verbs --- and is still a simple sentence: went shopping and perused
A compound sentence MUST HAVE TWO INDEPENDENT CLAUSES, which means TWO COMPLETE SENTENCES.
A complex sentence, however, has an independent clause with a subordinate clause. A subordinate clause cannot stand alone.
Example: When the boys went shopping for video games
A subordinate clause used as an adjective usually begins with words such as who, whom, whose, which, when and that.
Example: The boys, who were shopping for video games, .....
A subordinate clause used as an adverbial clause begins with relative pronouns such as: after, although, because, if, until when, etc.
Example: After the boys shopped for video games, .....
A complex sentence consists of both a sentence or independent clause and a subordinate clause.
Example: After the boys shopped for video games, they decided to go to the movies.
Subordinate clause: After the boys shopped for video games
Independent clause: they decided to go to the movies.
Even though the subordinate clause has a subject and predicate, it cannot stand alone in meaning.
So, the difference between a compound sentence and a complex sentence is that the compound sentence has two independent clauses that can stand alone in meaning but that the complex sentence has one independent clause and one subordinate clause. The subordinate clause cannot stand alone in meaning.