If the exposure was just for a few seconds, the chances of you getting anything from this are slim.
How did the condom break? Where was the rip?
If the head of your penis was covered, you don't have to worry about gonorrhea, chlamydia, HIV.
HSV1 is only transmitted by oral sex. If you didn't receive oral sex, hsv1 isn't a concern.
Even while using a condom, there is still a low chance you could get hsv2, syphilis and HPV.
A few seconds isn't really anything to be worried about.