A complex sentence is a type of sentence which contains at least one independent clause and one dependent clause. Typically, the dependent clause is used for (de)emphasis or to provide extraneous, though useful, information. For example:
"I went to the store. I didn't buy any eggs." are two simple sentences. Combining them to be "I went to the store, but I didn't buy any eggs." makes them into one compound sentence. However, meaning can still be clarified by turning "I went to the store" into a dependant clause thusly: "Although I went to the store, I didn't buy any eggs." In this way, we can tell that the fact the store was less vital than the fact that I didn't buy eggs. Perhaps I am baking no-bake cookies, or trying to insinuate that I already have eggs.
The definition of a compound-complex sentence is left as an exercise to the reader.