Pregnant

Ok I have a question it’s dumb but whatever:

If you have sex with a condom then get your period the next day does that mean you avoided the pregnancy completely? Just confused because I know sperm can live inside you for a bit.