There may be some rules but I don't recall seeing any. Common sense and logic should be enough. I can think of a situation in which I could say: I had waited until they left.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.