If action is linked with present(either action may have continued till now or its effect is still there), we use present perfect tense.
Example: The Principal has just sent for you.
If action has occurred in past in past and an action has taken place before another in the past, we use past perfect tense.
Example: I had lived in India.
If an action which will have been completed before a given time in future, we use future perfect tense.
Example: I will have revised the all the lessons by Saturday.