If I had two more questions right, I would have passed.
I could have passed with two more questions.
I failed the test because I was two questions short.
If I had two more questions right, I would have passed.
あと2問あっていれば合格できてた。
I could have passed with two more questions.
あと2問で合格できていたかもしれない。
上の二つでは、I would have / I could have でニュアンスが少し変わります。I would have passed は絶対合格できてたという確信がより強く、 I could have passed はできていたかもしれない、というニュアンスです。
I failed the test because I was two questions short.
2問足りてなかったために不合格でした。
Two questions short = 2問足りない(間違えていた、または回答できなかった)
どうぞご参考に。