The rule of the square is lesson 5 of 7 in Endgame 1: Basic mates and running pawns, an endgame course suited to players rated around 600 (beginners). When a passed pawn races a lone king, you do not need to count tempi move by move. Draw the square whose side runs from the pawn to the queening square: if the enemy king cannot step inside that square on its turn, it can never catch the pawn, and the pawn simply runs in to queen. The winning side pushes the pawn without wasting a move; dawdling with the king lets the enemy into the square. It has 6 interactive exercises: 6 calculated lines from real positions. You play every move on a board and get feedback straight away. The lesson is free.
What this lesson explains
Imagine a square drawn on the board with one corner on the pawn and the opposite corner on the promotion square, the same number of ranks as files. That is the pawn's square. If it is the enemy king's move and it already stands inside the square, it will catch the pawn; if it is outside, the pawn queens untouched. So the whole technique is to push the pawn straight home and not lose a single tempo. Moving your king instead, or nudging the pawn one square when two were available, can hand the defender the time to jump into the square.
What you practise
White to move: the enemy king is outside the pawn's square. Queen the pawn.
Black to move: run your pawn home before the king arrives.
Black to move: your pawn can outrun the king. Promote it.
White to move: push the passed pawn past the king.
Black to move: race your pawn home.
White to move: send the a-pawn home.
Worked examples
White to move: the enemy king is outside the pawn's square. Queen the pawn. The pawn ran straight down the board and queened while the enemy king chased in vain, always a step outside the square. When the king is out of the square, no king move by you is needed: just push.
Black to move: run your pawn home before the king arrives. The pawn sprinted to the first rank and promoted, the enemy king never reaching the square in time. Counting the square told you to push and never look back.