Virgin?

Me and my boyfriend had sex, but it hurts everytime I do it with him. And like is there a way to know if you are a virgin or not ? Could he be doing something wrong in the "sex" part of it?