Buoyancy is an upward force exerted by a fluid that opposes the weight of a partially or fully immersed object. In the case of a swimmer, the fluid is water. Buoyancy is caused by the difference in pressure between the top and bottom of the object. The pressure is greater at the bottom of the object than at the top, which creates an upward force.
The amount of buoyancy that an object experiences depends on its volume and the density of the fluid. The greater the volume of the object, the greater the buoyancy force. The denser the fluid, the greater the buoyancy force.
In the case of a swimmer, the volume of the body is greater than the volume of the water that it displaces. This means that the swimmer experiences a net upward force, which is what keeps him afloat.
The density of the human body is about 1 g/cm3, while the density of water is about 1 g/mL. This means that the human body is slightly less dense than water, which is why it floats.
The ability to float is not unique to humans. Many other animals, including fish, whales, and dolphins, can also float. This is because they have bodies that are less dense than water.