Would have had to is used where there is a sense of hypothetical action in past.(Here it gives the sense of doing that hypothetical action if some another action was not happened). Lets understand this concept by examples :
Rule 1. This rule states that we use “would have had to” in case where subject had no choice in past other than performed the action.
Examples : 1. You would have had to go to office at 1 Jan if office had opened.
2. I would have had to fight alone if you were not with me at that time.
3. I am so fortune to have worked in this company or else i would have had to go for looking a new job in this pandemic.
4. They would have had to go shimla if they had not made a plan for Dalhousie.
5. She would have had to celeberate her birthday alone if you had not arranged a party for her.
Rule 2. Where there is a sense of completing a action in strong possibility and in least possibility, we apply this rule.
Here, we need to replace Would with May or Might in the sentences according to the strong and least possibility respectively.
Examples : 1. He may have had to go there if rahul were absent.(strong possibility)
2. He might have had to go there if rahul were absent. (least possibility).
3. I may have had to fight on this decision if that had not been changed.
4. I might have had to work full day if he had not handled that work.
5. You may have had to live with her if her dad had left.