Well it depends on how old your friend is, how old your boyfriend is, and what state you live in (assuming that you're from the United States). If one of the participating individuals (whether that is your friend or the boyfriend) is over 18, he/she cannot have sex with someone who is a minor or under 18. Depending on where you live, the age of consent for sex may vary and some states enforce a rule where you and your partner can't have over a 3 or 4 year gap difference.
Aside from age, another thing that would make sex illegal is the lack of consent from either party. If your friend's boyfriend is pressuring her to have sex and she doesn't want it, then her boyfriend doesn't have consent and therefore it is illegal for him to have sex with her regardless of their age. So in this case, the age thing doesn't really matter anyway. The fact that both parties aren't in agreement is illegal already (if they do end up having sex). As long as your friend continually says no for everything she doesn't want, then her boyfriend doesn't have the right to do anything to her. And if he does, it's against the law.