The correct answer is C. had known.
The subjunctive mood is formed with if and would, and the purpose is to express the idea of a situation that is not real or an immaginary one. Like a conditional, it states what could or would happen if the situation were different. If he had known this fact would happen, he would have done it differently.