Теория:

Study some signal words for Past Perfect.
 
  
Words for Past Perfect:
  
before — перед тем как, до;
 
after — после;
 
already — уже;
 
just — только что;
 
for — в течение;
 
since — с тех пор;
 
till/until — до тех пор;
 
by the time — к тому времени;
 
never — никогда;
 
earlier — ранее;
 
when — когда;
 
yet — ещё не.
 
 
Examples
 
She knew how to cook a cake because she had made it earlier
  
cake.jpg

James easily won this game because ha had played it many times before
  
game.jpeg

John had sat to work when his boss called for him. 

We had already bought a cake when Jill called us and told that she bought a cake too. 
  
I hadn’t served the table yet when the guests came.
Источники:
www.chess.com/article/view/how-to-win-a-chess-game
http://bekicookscakesblog.blogspot.com/2014/01/cake-decorating-and-baking-classes.html