Why won’t his dick stay hard?

So I have a question.

What can’t guys get hard sometimes right before sex? Am I doing something wrong?

Honestly I feel like it’s me, like I’m not doing something right. He says it’s not me but I can’t help to think otherwise. I would suck and rub and he will get hard for a minute then right when he tries to go in, it get soft again. He says it’s because he is nerves but I don’t believe him. He also said it’s probably because he was high. Can somebody please explain!