What determines whether a missed four-rak'ah prayer is made up as 2 or 4?

The Traveler's Prayer: Travel Threshold, Qasr, Residence, and Watan