Erection requires a free body and mind, your mind is free when you think of sex or when in foreplay, as soon as you think of or try penetration, your mind gets worried of performance giving stress. It's this performance anxiety which takes away erection. For some days focus and get involved in foreplay only .. when you have no stress of penetration you ll get erection by default. Sometimes medicines can assist you to get the desired erection maintain it and then perform.
It's just a phase and is supposed to go away because stress in interfering. It it don't work consult a good doctor who ll do the needful. Good luck
Next Steps
meditation and relaxation exercises. conviction of his sexuality
Health Tips
be cool. sex never vanishes on its own and has a tendency to bounce back usually.