It sounds like he needs to get a physical. There are a lot of health problems that can cause erectile dysfunction such as unrecognized diabetes, high blood pressure, atherosclerosis (narrowing of arteries), high cholesterol, and obesity. Certain medications can cause ED and age may be a factor as well.
And, obviously, if he has recently had sex or masturbated, he may not be able to sustain an erection.