The future perfect tense is used to express that an action will be completed before a point in time in the future (any time up to that point). This point can be implied or expressed with a time expression or a clause with a verb in the present simple tense:
The preposition for is used with the future perfect tense to express that something will start before a point in time in the future (or has already started) and that it will still be true at that point:
The past perfect continuous tense is used to express that an action started before a point in time in the past and that it was still in progress or it had just stopped. This point can be implied or expressed with a time expression or a clause with a verb in the past simple tense:
The past perfect tense is used to express that an action was completed before a point in time in the past. This point can be implied or expressed with a time expression or a clause with a verb in the past simple tense: