When does a body to float in a liquid?
The density of the object is less than that of the liquid.
When an object is completely immersed in a liquid, weight of the body is acting in the downward direction and the liquid exerts a force called upthrust in the upward direction on the object. The object sinks in the liquid if the weight of the body is greater than the upthrust acting on the object by the liquid. The object rises to the surface of the liquid if the weight of the body is less than the upthrust acting on the object by the liquid.
I.e. the density of the object must be less than the density of liquid for it to float.