Main Clause: a grammatically complete sentence that can stand alone.
Subordinate Clause: a phrase that is not grammatically complete. It is missing some part and can not stand alone.
Normally, a subordinate clause is combined with a main clause and gives extra information about it. Subordinate clauses are joined with main clauses with conjunctions ("dass," "wenn," "weil," …) or relative pronouns. In subordinate clauses, the conjugated verb goes at the end.
Subordinate clauses must be separated from the main clause with a comma.
In the main clause, we follow the normal rules of word order for a sentence - i.e. the verb in position 2.
In the subordinate clause, the conjugated verb goes to the end.
The entire subordinate clause is position 1 of the main clause. This is followed by the conjugated verb (in position 2), and then comes the rest of the main clause.
For separable verbs we must also follow the rule: conjugated verb at the end.
That means the verb stem is also at the end, so we no longer separate the prefix.
For modal verbs, the perfect tense, the passive voice, etc., there‘s more than one verb in the sentence.
The rule still applies: conjugated verb at the end of the clause. This means the other verbs go in the second to last position (and third to last position, if necessary).
For perfect or past perfect, there is an exception to the rule about the conjugated verb going at the end.
Modal verbs and other verbs that are used with a 2nd verb in the infinitive form (i.e. "lassen," "sehen," "hören") have an irregular word order in perfect and past perfect tenses. The conjugated helping verb "haben" goes IN FRONT of the two other verbs (main verb + modal verb):
As main clause:
As subordinate clause:
Modal verbs always use "haben" as the helping verb in the perfect tense.
Besides the modal verbs, "lassen," "sehen," and "hören" CAN be used with a second infinitive verb. If they are used in this way, the helping verb goes before the main verb as well
Now you know why Germans, when possible, use the simple past tense instead of the perfect tense with modal verbs!
Info about German conjunctions in general.
Conjunctive adverbs are similar to conjunctions but follow different grammar rules.