Floating and sinking of an object depends on:
density of object and fluid
Floating and sinking is related to the density of the liquid and the density of the body immersed in the liquid.
If the density of the body is more than the density of the liquid, the body sinks.
If the density of the body is less or equal to the density of the liquid, the body floats.