A simple sentence is one independent clause.
As long as there is one subject and one predicate and the clause can stand on its own, it is a simple sentence.
A compound sentence is two or more independent clauses joined together usually by a coordinating conjunction.Coordinating conjunctions are and, but, for, or, nor, yet and so.
A Complex sentence contains one independent clause (the boy ran) and one or more dependent clauses (when he was at the park).
If the dependent clause comes at the beginning of the sentence, a comma should follow it. (When he was at the park, the boy played.) If the dependent clause comes after the independent clause, no comma is necessary. (The boy played when he was at the park.)