Also one other thing that happens with me and my gf occasionally. A guy gains an erection for sex based on being turned on. But it doesn't stay up forever! It needs something more (more stimulus) to keep it up - touching it, touching you or other visual stimuli can all work.
The problem I have occasionally is that the foreplay takes too long! Now I know men are like a switch, and women are like a thermostat. And the womans thermostat doesn't heat up instantly. Thing is, by the time the women is ready, the man could have already had an erection for 5-10 minutes in his pants. But the mans mind/body says - "hey what's the point, I'm getting no action, well just turn it off for a while". And down goes the erection just as the condom comes out :(
In 5 minutes of course we are ready to go again. So it's more of a timing thing in this case. Once the penis is out, make it hard, put the condom on and get to it!!