Floating of an object in a particular liquid depends on buoyancy.
Buoyancy is the upward force exerted by the liquid opposing the weight of the immersed object.
When an object is immersed in liquid, the volume of water rises.
Now, Buoyancy is equal to the weight of the volume of water that rises(or spills).
If the body has to float on the liquid, weight of the body <= Buoyancy.
(considering g to be common, taking weight=mass.)
∴ mass of the body has to be less than or equal to the mass of liquid. (if it needs to float).
Considering a case where the body is completely immersed,
weight of body = weight of liquid displaced.--- 1
volume of body = volume of liquid displaced--- 2
Density of body = density of liquid.(for the body to float being completely submerged).
Therefore, whether of not a body will float in a liquid is determined by its density(or relative density with the liquid).