When does sperm die?

I've heard that sperm dies immediately when it hits the air, so therefore We've always used the pull out method. Then I recently heard that sperm doesn't die until it dries... And in a way they both make sense bc I know that if the sperm touches the vagina and it  finds a way inside it can swim up, but then again wouldn't it die bc of the difference in temperatures?