What counts as sex?

Does sex only count if it goes in the vagina canal hole/period hole, or does it count if the penis has been anywhere inside your vagina?