The past perfect, as in the second sentence, is used when the event being described (reaching home) happened before some other event which is also in the past. The complete sentence in that conversation might be "I had just reached home when the telephone rang." The other event might be in a different sentence:
A: "The telephone rang at 5 o'clock."
B: "What were you doing when it rang?"
A: "I had just reached home."