At the latest, you take 2 pills before the anticipated sexual contact (and at the earliest 24 hours before the sexual contact). If your latest pill was less than 7 days ago, it is sufficient to take one.
Afterwards, you take one pill every 24h, until two days after the last sexual contact. You should take a minimum of 4 pills in 3 days (or 3 pills in 3 days if your last pill was less than 7 days ago).
It is important not to stop earlier!
Pills should be taken on the same moment as the first intake, within a timeframe of 4 hours (2 hours before, 2 hours after).
If you are too late (more than two hours after the initial hour) and you were at risk for HIV infection, then you should start PEP as soon as possible.