He can't stay hard

Katie
So my BF  (20) of over a year now has struggled with keeping it up. I remember when we first got together that we didn't have sex for MONTHS and when we did everything seemed fine so I didn't think anything of it. Then we do it on a sorta regular basis And then I notice that he either doesn't finish or goes soft. I've been very supportive and he has gone to the Dr. He thought it may be Low-T because his dad has it. He was tested and it came back negative. He was perscribed viagra which is great and all if you want to plan when you have sex. We're young you know? I dont want to have to worry about pills and timing when I want to have sex so I guess the best question here is has anyone gone through this too? And if so was there anything that improved it? 
Additional information: He has suffered from depression but it has gotten better over the past couple of years. Also that I don't think this is a "disinterest" kinda thing he rarely watches porn and he has told me over and over that none of this is because of me ( he's not going soft because of what I look like physically)