A complex sentence is made from an independent clause and a dependent clause joined together.
After I came home, I made dinner
(dependent clause: "After I came home")
(indpendent clause: I made dinner)
We visited the museum before it closed.
(dependent clause: before it closed.)
(independent clause: We visited the museum)
Complex sentences are often formed by putting these words at the beginning of the dependent clause: as, as if, before, after, because, though, even though, while, when, whenever, if, during, as soon as, as long as, since, until, unless, where, and wherever. These words are called subordinating conjunctions.