As an additional explanation: the other two images were wrong because digging a hole in one of the 8 squares surrounding the hole blocks one of the places the money can go, so you'll get less.
The rock also won't spawn the maximum amount of money if you take too long to hit it 8 times. So while the 2 hole setup is technically enough to get a position where you won't be pushed back, a line of 3 might be safer since you won't have to be as precise with your position to prevent yourself from scooting up or down along the edge of the holes.