My bf can't hold an erection, he has lost it twice during intercourse and a few times during foreplay, how do we know why this is? He is 25 non smoker.

Can happen 2 anyone. If temporary, it is not uncommon. It can be due to the fact that men become used to manual stimulation or need a little change to get aroused. We suggest changing it up in the bedroom, trying a different sexual position, stimulating other areas of his body first, etc. A partner should also tell a man to do the same to her and enjoy exploring each other in a new sensual way. Mt of MS by @drpam.
See a doctor. While psycho-social reasons (stress, distraction, fatigue, smoking, alcohol, drug use, etc.) are most common at that age, there are medical issues that may be affecting the situation as well. Diabetes and high blood pressure are common, even at age 25. A thorough medical exam with his doctor would be a good next step.
Several Reasons. He may be under stress. It may be valuable to talk about what is going on. Also, if he has had alcohol, that can cause a problem. He should see his doctor.