Let's analyze a shorter sentence:
Wenn wir uns hätten verstecken können, dann wäre alles anders verlaufen.
If we could have hidden, then everything would have been different.
This is a typical wenn-dann (if-then) construction. But the then part is missing in your sentence. That's why it ends in an ellipsis (three dots).
The word wenn (if) introduces a temporal subordinate clause. And in subordinate clauses all verbs of a sentence stand at the end. (There are different rules for questions and commands.) In main clauses of statements there must always be one of the verbs (the finite verb) at position 2, but in subordinate clauses even the finite verb must stand at the end together with all other verbs:
- main clause of a statement: finite verb at position 2, all other verbs at the end of the clause:
Wir hätten uns vergangenen Sonntag gemeinsam mit den anderen in dem kleinen Waldstück verstecken können.
- subordinate clause: all verbs at the end of the clause:
Wenn wir uns vergangenen Sonntag gemeinsam mit den anderen in dem kleinen Waldstück hätten verstecken können, dann wäre alles anders verlaufen.
So, what is a finite verb and what kind of verbs are the other verbs which are always located at the end of the clause?
There are different kinds of verbs:
Full verbs
These are the verbs you usually have in mind when you think about verbs. These are verbs like essen (to eat), öffnen (to open), laufen (to run) and many others. Every clause must contain exactly one full verb.
Auxiliary verbs
These are verbs that do not carry any meaning. They are only in the sentence for grammatical reasons, to indicate a grammatical tense. German has exactly 3 auxiliary verbs:
Haben, sein und werden
sind die drei Hilfszeitwörter auf Erden.
To have, to be and to become are the three auxiliary verbs on earth.
Forms of haben and sein are used to indicate the tenses Perfekt, Plusquamperfekt and Futur II. Which of them has to used does not depend on the tense but on the full verb. Each full verb has it's individual favorite auxiliary verb. Rule of thumb: Verbs that describe a state like schlafen (to sleep) need haben. Verbs that describe a transition like einschlafen (to fall asleep) need sein.
- Perfekt
Ich habe geschlafen.
Ich bin eingeschlafen.
- Plusquamperfekt
Ich hatte geschlafen.
Ich war eingeschlafen.
- Futur II
Ich werde geschlafen haben.
Ich werde eingeschlafen sein.
Forms of werden are used to indicate the tenses Futur I and Futur II, independent from the full verb.
- Futur I
Ich werde schlafen.
Ich werde einschlafen.
- Futur II
Ich werde geschlafen haben.
Ich werde eingeschlafen sein.
As you can see, Futur II needs two auxiliary verbs in addition to the full verb, so you already have 3 verbs in the predicate when you use the tense Futur II.
The verbs schlafen and einschlafen do not need any objects, so you can create short sentences which is fine to create simple examples, but without additional parts in the sentence it becomes difficult to distinguish between position 2 and the last position. So, lets add additional material to one of the examples given above:
Futur II, main clause with additional stuff including a relative clause
Ich werde morgen Abend, wenn du nach einem langen Tag endlich nach Hause kommen wirst, bereits eingeschlafen sein.
I will have fallen asleep already tomorrow night when you finally come home after a long day.
Futur II, subordiante clause with additional stuff including a relative clause
Wenn ich morgen Abend, wenn du nach einem langen Tag endlich nach Hause kommen wirst, bereits eingeschlafen sein werde, dann darfst du mich aufwecken.
*Tomorrow night, when you finally come home after a long day, if I already will have fallen asleep, you can wake me up.
Note, that all modal verbs have homonyms that are full verbs:
Ich bin krank. Ich habe Hunger. Ich werde Arzt.
And that these full verbs also can be combined with auxiliary verbs:
Ich bin krank gewesen. (Bin is a form of the auxiliary verb sein, gewesen is a form of the full verb sein)
Ich habe Hunger gehabt. (Habe is a form of the auxiliary verb haben, gehabt is a form of the full verb haben)
Ich werde Arzt werden. (Werde is a form of the auxiliary verb werden, werden is a form of the full verb werden)
Modal verbs
Full verbs must always be there, and auxiliary verbs must be there to indicate 5 of the 6 German tenses. But modal verbs are optional. In most grammar textbook you will find these 6 modal verbs:
- dürfen (to may, to be allowed to)
Ich darf schlafen. - I may sleep, I'm allowed to sleep.
- können (to can, to be allowed to, to be able to)
Ich kann schlafen. - I can sleep. I'm allowed to sleep. I'm able to sleep.
- mögen (to like to)
Ich mag schlafen. - I like to sleep.
- müssen (to must, to have to)
Ich muss schlafen. - I must sleep. I have to sleep.
- sollen (to shall, to be supposed to)
Ich soll schlafen. - I should sleep. I'm supposed to sleep.
- wollen (to want to)
Ich will schlafen. - I want to sleep.
Sometimes also some other verbs behave like modal verbs:
Du brauchst nicht anzuklopfen.
Wenn du das sagst, wird es schon stimmen.
The point is, that you almost always can add modal verbs to a clause:
- Only the full verb (Präsens)
Ich schlafe.
- Full verb + one auxiliary verb (Futur I)
Ich werde schlafen.
- Full verb + two auxiliary verb (Futur II)
Ich werde geschlafen haben.
- Full verb + modal verb (Präsens)
Ich will schlafen.
- Full verb + modal verb + one auxiliary verb (Futur I)
Ich werde schlafen wollen.
- Full verb + modal verb + two auxiliary verb (Futur II)
Ich werde schlafen gewollt haben.
In the last sentence you have 4 verbs in a row, but only because there is no additional stuff in this main clause. When you add something, it must go between position 2 and the last position:
- Main clause with additional material
Ich werde morgen Abend, wenn du nach einem langen Tag endlich nach Hause kommen wirst, bereits schlafen gewollt haben.
But when you make a subordinate clause out of it, then also the finite verb moves to the end:
Wenn ich morgen Abend, wenn du nach einem langen Tag endlich nach Hause kommen wirst, bereits schlafen gewollt haben werde, dann darfst du mich aufwecken.