The number 21 being the highest salute, the sentry takes 21 steps, faces the tomb for 21 seconds, turns and pauses 21 seconds, then retraces his steps.
The number 21 is explained on the U.S. Army Center of Military History website (history.army.mil/index.html):
“Warriors … demonstrated their peaceful intentions placing their weapons in a position that rendered them ineffective …
Rendering a salute by cannon originated in the 14th century as firearms and cannons came into use. Since these early devices contained only one projectile, discharging them once rendered them ineffective.
Originally warships fired seven-gun salutes–the number seven probably selected because of its astrological and Biblical significance … The Bible states that God rested on the seventh day after Creation, that every seventh year was sabbatical and that the seven times seventh year ushered in the Jubilee year.
Land batteries, having a greater supply of gunpowder, were able to fire three guns for every shot fired afloat, hence the salute by shore batteries was 21 guns …
Early gunpowder, composed mainly of sodium nitrate, spoiled easily at sea, but could be kept cooler and drier in land magazines. When potassium nitrate improved the quality of gunpowder, ships at sea adopted the salute of 21 guns.
The 21-gun salute became the highest honor a nation rendered …
Great Britain, the world’s preeminent seapower in the 18th and 19th centuries, compelled weaker nations to salute first …
Eventually, by agreement, the international salute was established at 21 guns, although the United States did not agree on this procedure until August 1875.”