The pressure exerted by a body is given by the relation P = F/A. When we stand on loose sand our area in contact with sand is small, therefore, pressure is large. Hence, we go deep. But while lying down the area in contact becomes large. This decreases the pressure. Hence, our body does not go deep into the sand.