A complex sentence is one which contains only one main clause and one or more subordinate clauses.
If you work hard you will pass.
In the above example the clause “you will pass" makes good sense by itself and hence is called as the main or primary clause. The clause “If you work hard" cannot stand independently, it depends on the clause"you will pass". It is thus called dependant or subordinate clause.
Some more examples:
As soon as the meeting began a member said that he wanted to raise a point.
The children rode an elephant when they visited the zoo.