Nice to meet you on this board, a warm welcome
First of all, I'm not an English teacher. Nevertheless, I can give some advice about using the past perfect.
You use the past perfect when you talk about actions and you jump further back into the past. When you tell something in a non-chronological order. This is a tense which is often used. Especially when you are having a conversation with someone. You are talking and you don't always tell things in the chronological order. You forget to tell something and then suddenly it pops up and you tell it anyway. If you are talking in the past tense, you then have to use the past perfect!
1- When I arrived Ann had just left.
2- When she had sung her song she sat down.
3- Her hear had been grey; now it was white.
4- I had just poured myself a glass of water when the phone rang.
5- Tom was 23 when our story begins. His father had died five years before and since then Tom had lived alone. His father had advised him not to get married till he was 35, and Tom intended to follow this advice.
One of the basic rules is that you use the Past Perfect when you are talking about things which happened in the past. And when then, jump even further more into the past.
Hope that this is a help