Compound sentences have more than one independent clause. Complex sentences have dependent clauses. Compound-complex sentences have both.
(simple) My dog ate my homework.
(compound) My dog ate my homework, so I had to think up a good excuse.
(complex) My dog ate the homework that I left on the chair.
(compound-complex) My dog ate the homework that I left on the chair, but fortunately I still had the outline that I had written.