You need a few variables - deathCounter and lastAD (death number when you last shown the ad).
If deathCounter>(lastAD+5), then you can show an ad with 50% chance
Once the ad is shown, set lastAD to deathCounter.
Another option - you can save the system time when the last ad was shown. If more than 2-3 minutes have past, you can show the ad again.