my first was a 27 weeker :/ terrified this time around

I'm so scared to have sex now that we are expecting our 2nd baby. Our first was a 27 weeker. I started to have contractions out of the blue and then my water broke. The doc said sex can cause contractions and sperm in the vagina also. I feel so scared to even try since he said to take it slow :/