How does black ensure a draw in this R+3P vs. r+2p endgame with all pawns on the same side? From a recent world-championship game Fabiano Caruana vs Magnus Carlsen (2018), the players agreed to a draw here:

[Title "Black to move"]
[FEN "8/1r3kp1/7p/7P/4R1P1/6K1/5P2/8 b - - 2 54"]


However, I played this position as black against the computer, and it quickly crushed me.  Obviously I'm doing it wrong.

Question: How does black ensure a draw in this rook and pawn endgame?

My play was rather planless (basically I don't know where to put the king and rook---I think the pawns should not be moved), so after a few "I don't really know what to do, but this move isn't immediately losing" moves, I end up having to make critical moves, then end up making a mistake.

I played several times vs. the computer now; here's one example: 

8/1r3kp1/7p/7P/4R1P1/6K1/5P2/8 b - - 2 54

54... Ra7 55. Kf4 Kf6 56. Rc4 Ra5 57. Rc6+ Kf7 58. f3 Rg5 59. Rc7+ Kf6 60. Rc6+ Kf7 61. Ke4 Ra5 62. Rd6 Ke7 63. Rc6 Kf7 64. Rd6 Ke7 65. Rd5 Ra4+ 66. Kf5 Kf7 67. Rd7+ Kg8 68. Ke6 Rf4 69. Rd3 Rf6+ 70. Ke5Kf8 71. Ra3 Kf7 72. Ra7+ Kf8 73. Ke4 Rb6 74. Kf4 Rc6 75. Ke5 Rf6 76. Ra3 Kf7 77. Ke4 Kf8 78. Ra8+ Kf7 79. Ra7+ Kf8 80. f4 Rb6 81. Kf5 Rc6 82. Ra8+ Kf7 83. Ra7+ Kf8 84. Ke4 Rc5 85. Rb7 Kg8 86. Rd7 Kf8 87. Rd5 Rc4+ 88. Kf5 Rc6 89. Ke5 Kf7 90. Rd7+ Kf8 91. Rd6 Rc5+ 92. Ke6 Rc8 93. Kf5 Re8 94. Kg6 Re7 95. Rd8+ Re8 96. Rxe8+ Kxe8 97. Kxg7


(I'm not sure what I'm doing wrong with the replayer here.)

Sometimes the computer would draw because it didn't seem to playing for a win (e.g. pushing pawns, or just letting them hang).
The following explanation is for the general 3 vs 2 pawns on one side situation, which does apply also to this game. Of course the situation is the same whether the pawns are on the a-c files or on f-h files.



This is a fairly simple draw if you follow a few simple rules:


don't exchange rooks
do exchange pawns whenever possible
keep your king close to your pawns
if necessary block the enemy king or check using your rook


If you do this, your opponent should not be able to enter your camp or bother you with checkmate or anything. 

That leaves your opponent with one winning attempt only, which is to create a passed pawn in the center (here on the f-file). 

In order to prevent this, the usual recommended set-up is to push the pawn on the border of the board forward (here the h-pawn) and to protect it with the pawn on the adjacent file (here g-pawn). (This setup is already realized in the quoted game with black pawns on g7 and h6.) 

This setup ensures that in order to create a passed pawn, the opponent has to exchange all other pawns first. 

The resulting position with rook+pawn vs rook should then be an easy draw as the defending king is placed close to the queening square of the pawn.



The same general rules apply to 4 vs 3 pawns + rooks endgames. A good pawn structure for the defending side would be h5-g6-f7 (or similarly on the other 3 corners of the board). 4 vs 3 pawns is slightly more tricky as there are more pawns that need to be exchanged in order to secure a draw.