I think the OP is not only thinking himself but also making us think to know as to which of the two actions happened first. As a good rule of thumb, I have never thought so whenever I used the word "until" as a conjunction in the past. However, I keep it in mind that the "until" is used as a conjunction in two senses as follows:
When it's used in the first sense and we are talking about events in the past, it's very common that the main clause (mc) and the subordinate clause (sc) with "until" are both in the simple past or the mc is in the past simple and the sc is in the past perfect. Such a sentence is usually positive. Please look at the following sentences:
*I waited until the doctor came/had come.
*They played until it got/had got dark.
The use of the past perfect in the above sentences in the sc is not because the events happened earlier but because we want to emphasize or accentuate the events in the mc.
The use of the past perfect in the mc to stress the event,though not incorrect, is found seldom. For example, I had waited until the doctor came.
Now we come to the sentence in question:
The people took shelter under a tree until the rain stopped/had stopped. The sentence is 0K in light of the above; there is no doubt about it.
The people had taken shelter under a tree until the rain stopped. The use of the past perfect in the mc, though not common, is grammatically correct.
"If I had taken that bus I would be safe and warm right now."
This is correct. It's what's known in some EFL/ESL textbooks as a "mixed conditional" or "mixed 2/3 conditional" because the "if" clause has a verb in the past perfect (as in the third conditional) but the consequence clause has the construction "would"+bare infinitive (as in the second conditional).
Like a third conditional, the "if" clause describes a condition that is in the past - a past unreal condition that was not met. But like a second conditional, the consequence clause describes a consequence that is in the present (not a consequence in the past).
In the third conditional you'd say "If I had taken that bus I would have been safe and warm", but instead you want to express the fact that if you'd done things differently you'd be safe and warm now, so you use the mixed construction. It's perfectly standard and perfectly logical.
"If I die tomorrow I’d be alright because I believe…"
This, on the other hand, is badly worded. It should be either "If I die tomorrow, I'll be all right..." (first conditional) or "If I died tomorrow, I'd be all right..." (second conditional). (The form "If I were to die tomorrow, I'd be all right..." is also fine and is a variant of the second conditional. I use the spelling "all right" because in British English the spelling "alright" is sometimes considered nonstandard.)
Best Answer
Both are correct, and both have the same effective meaning in the context, but the logic is different.
The logic of the first sentence is: We are not home right now because we didn't stop that taxi earlier.
The logic of the second sentence is: We haven't arrived home yet because we didn't stop that taxi earlier.
To "not be home" and to "not have arrived at home yet" are semantically the same thing, so the sentences have the same meaning in the context.