His penis was near my vagina but not inside me. Semen was ejaculated from his penis. As soon as possible, he went back to prevent no sperm from going inside me. Also my vagina was not wet. Is there still any chance that sperm could have entered my vagina?
Whenever a man and woman engage in sexual behavior, there is always some risk of pregnancy and a risk of sexually transmitted diseases. In this particular case, it sounds like the odds of pregnancy is very low -- almost zero. Though he did not ejaculate near you, he would have dripped pre-ejaculate fluid and that fluid can contain a few sperm. It only takes one sperm reaching your egg to cause pregnancy. The odds that one was present is low. The odds of it reaching your uterus is even lower.
But all of this is relatively minor. What is far more important is that you and he are sinning. You two were engaged in lewd behavior. "Let us walk properly, as in the day, not in revelry and drunkenness, not in lewdness and lust, not in strife and envy. But put on the Lord Jesus Christ, and make no provision for the flesh, to fulfill its lusts" (Romans 13:13-14). Essentially you began engaging in sex but did not finish. Sex between two people who are not married is called "fornication." "Do you not know that the unrighteous will not inherit the kingdom of God? Do not be deceived. Neither fornicators, nor idolaters, nor adulterers, nor homosexuals, nor sodomites, nor thieves, nor covetous, nor drunkards, nor revilers, nor extortioners will inherit the kingdom of God" (I Corinthians 6:9-10).
You and your boyfriend had no business touching each other in sexual ways. You had no business exposing yourselves to each other. While this time he did not put his penis into you, what exactly would stop him from doing so if he decided to put his penis into you? In the position you were in, you would not have been able to stop him and given the mood of the situation, you likely would not be inclined at that moment to stop him either. You would not be able to claim it was an accident or that it was unintentional because if your intention is to live righteously you not be naked with a boy and allowing him to rub his genitals against yours.