As long as the water your body displaces weighs more than you do, you float. This is, in short Archimedes' Law. A human submerged in water weighs less (and is less ‘dense’) than the water itself, because the lungs are full of air like a balloon, and like a balloon, the air in lungs lifts you to the surface naturally.
If an object or person has a greater density than water, then it will sink. If its less dense than water, then it will float. Density is determined by mass and the amount of space it takes up (its volume).This is why wood floats and lead sinks. It is also why heavy metal ships can float on the water, it’s because they're big enough to have an overall density that's less than that of water. However, if you crushed the ships down into a ball and got rid of all of the empty space, the metal ball would sink like a rock, due to the increased density. With regards to humans, this concept is very similar - the ability to float on water has a number of different variables.
When it comes to floating in water for humans, there are generalised gender related differences. Genetically men tend to have more muscle mass than women, which limits their buoyancy potential. This means women are more likely to be able to float than men. Age is also a factor at play. Fat is less dense than muscle, children and teenagers tend to carry less fat than adults, so it's for this reason, it’s easier for them to drown than float.
Other genetic factors, people who have more bone and muscle constitution are scientifically more likely sink than those with smaller structures.
It is also important to consider psychological implications. A person who does not know how to swim or does not feel confident in water, is likely to become nervous if submerged. This can lead to swallowing water and sinking due to erratic movements.
In short, your ability to float is determined by the composition of your body. In other words, if you are thin and muscular and have a low or even normal body fat percentage, you are more likely to naturally sink. If you have a higher percentage of body fat, it’s more likely that you will float.