I tried twice to lose my virginity ...

I've tried twice to lose my virginity to my girlfriend twice but the penis never gets hard enough. The first time I still thought it was nervous, but even during masturbation, it only becomes fully erect by orgasm. I do not know what to do, I'm desperate I'm only 16 and this phase of life is very important, thank you.
Expert answer:

In medicine we have a name for it (the terror of all men) sexual impotence, luckily there is treatment, most of the time in young adults the main cause is emotional, need to seek a doctor called urologist, he will do the correct diagnosis and the treatment (medicines, therapy, conditioning techniques and training ...)