Theorie:

Study the information about spelling in the past perfect continuous.
  
shutterstock_726516163.jpg
  
Past perfect continuous (spelling tips for adding the ending -ing to a verb):
 
Add -ing to most verbs.
play – playing
shutterstock_1419914186.jpg
For verbs that end in -e, remove the -e and add -ing.
ride – riding
shutterstock_365215922.jpg
For verbs that end in -ie, change the -ie to -y and add -ing.
die – dying 
                                                
shutterstock_350525774.jpg
For verbs with last syllables being stressed 'consonant-vowel-consonant' combinations, double the last letter before adding -ing.
beg – begging  
shutterstock_770394307.jpg
 
  
Examples:
  
They were tired. They had been playing for 2 hours.
  
My friends were happy. They had been riding horses for 3 hours.