In other words, there are dozens of reasons he might not be getting it up, which have absolutely nothing to do with your relationship. Honestly, there's just no way for me to give you specific advice here. If it's a serious problem, you should encourage him to check in with his primary care physician first, and then, perhaps, a therapist, in the nicest way possible.
A common and important cause of ED is vasculogenic. Many men with ED have comorbid conditions such as hyperlipidemia, hypercholesterolemia, tobacco abuse, diabetes mellitus, or coronary artery disease (CAD).  The Princeton III Consensus recommends screening men who present with ED for cardiovascular risk factors; ED may be the earliest presentation of atherosclerosis and vascular disease. 
While pills for ED are convenient, some men sustain stronger erections by injecting medication directly into the penis. Drugs approved for this purpose work by widening the blood vessels, causing the penis to become engorged with blood. Another option is inserting a medicated pellet into the urethra. The pellet can trigger an erection within 10 minutes.
Don’t give up or blame yourself - you shouldn’t assume that your situation is impossible to improve or that your partner is disappointed in you. Studies show as long as you don’t stop trying to engage your partner sexually, they will still respond positively. If you communicate and stay positive you can work with your partner to get the result you’re looking for.
Men who wear tight underwear may also experience the same problems. Because of the constriction, feeling may be lost, and even if unnoticed actively, the brain will notice. This is part of the complication with erectile dysfunction between the brain and the body. While you may be in the mood, if the proper electrical signals are not sent back and forth, nothing will happen.
Pills such as Viagra® are the most common ED treatment, but they don’t work for everyone. Some guys find they cause bothersome headaches or persistent stomach troubles. Some have serious side effects such as chest pain and vision or hearing changes. Others don’t respond to the medication at all. And still others don’t like having to wait for the pill to take effect.
Having erection trouble from time to time isn't necessarily a cause for concern. If erectile dysfunction is an ongoing issue, however, it can cause stress, affect your self-confidence and contribute to relationship problems. Problems getting or keeping an erection can also be a sign of an underlying health condition that needs treatment and a risk factor for heart disease.