People float in water because the human body weighs less than the volume of water it displaces when submerged. The buoyancy of an individual depends on his or her body type, as those with more muscle tend to sink further, while those with more body fat float more efficiently.
When an object is placed into water, it is entering a cylinder of water from the surface to the bottom. It displaces some of the water in that cylinder, and the water beneath it exerts upward pressure. If the volume of water that is displaced is lighter than the object, the pressure will be insufficient to keep it afloat. If the equivalent volume of water is heavier than the object, the remaining water in the cylinder will keep it at or near the surface.
Human bodies tend to float due to stores of fat and to the volume of air stored in the lungs. However, those with very low body fat percentages may have a more difficult time managing to stay afloat. Lying horizontally can improve floating capacity, as it increases the surface area exposed to the upward pressure from the water. On the other hand, clothing can absorb water and increase in weight, possibly making the difference between floating and sinking.