I’ve had this same problem, and from my own point of view it was all caused by watching to much porn, and wanking to much with to tight a grip.
I never got to the stage where I couldn’t fully get an erection, but I was often banging woman with a semi erection, which makes sex a lot more awkward, and not as pleasurable for either of you. I also had big problems finishing. Either I wouldn’t finish at all which would upset any girlfriend, or I would last way to long.
What I did to fix the problem, was limit the wanking to once a week, and when I do it’s with my weaker left hand, and I don’t watch any porn or any other material when I do. Stopping watching porn completely is very important for this to work.
Obviously yours may be caused by a different reason, so I would agree about going to see a doctor first, but if the Doctor says you are all fine, then I would recommend doing what I’ve said above.
The other thing that will help, is living a healthy lifestyle, by eating healthy, and most importantly improving your cardiovascular fitness. Making your heart stronger will lower stress levels, and will improve your circulation which will only help get a better erection.
You may think that because your young it shouldn’t make a difference, but a 30 year old athlete, will have a much higher sex drive, and will be able to hold a much better erection than a 30 year old couch potato.
Best of luck.