A simple sentence has one independent clause.
Example: I don't like Math.
A compound sentence has two independent sentences (or independent clauses). They're joined by a semicolon or the coordinating conjunctions (and, but, for, so, yet, or, etc.)
Example: Next week I have an exam, so I'm revising the papers from last year. Malaysia is my favorite country, that's why I'm visiting it next summer.
A complex sentence consists on an independent clause and one or more dependent clauses. An independent clause can be a simple sentence, but dependent clause doesn't have sense alone.
Example: When she was a child, she loved to read fairy tales.
The book, thought very long, was very interesting and easy to read.