is a sentence which contains two or more independent clauses.
A compound sentence is connected by using coordinating conjunctions, such as and, or, but, so.
I am repairing a computer and my brother is watching TV.
She likes fried chicken but I like pizza.
is a sentence which contains one independent clause and one or more dependent clause(s).
A complex sentence is connected by using subordinating conjunctions, such as when, while, if, although, because, as, after, before, until, or by using relative pronouns and relative adverbs, such as who, which, that, when, where.
These connective words can express time, cause, condition, concession (contrast), or identification.
They couldn't go out because it was raining cats and dogs.
When I came to her house, she was watering the flowers.
is a sentence which contains one or more independent clause(s) and one or more dependent clause(s).
When I came to Susan's house, she was watering the flowers and her father was weeding the grass.
The man who stole my car was arrested, but her friend escaped.