Rule reminder
Use trapassato prossimo for the earlier of two past actions — the one that was already completed when the other occurred.
Quando siamo usciti, il sole … (tramontare) già.