Vaginal sex yes, Anal sex - no. Either way, BOTH should be protected at all times. You are severe risk of catching an STD.
Doesn't matter whether he ejaculates or not - pre ejaculation is released and it doesn't matter how long it was inside you for you can still become pregnant from this.
Since your period is late, you could be pregnant and you would need to take a home pregnancy test with first morning urine to see what it says.
Any time you have unprotected vaginal sex there is a chance.