The floating of an object in a fluid depends on
density of the fluid
Downward force acting on a body in liquid = Weight of the body = Volume of the body × Density of body × Acceleration due to gravity
Upward force acting on the body = Weight of liquid displaced = Volume of the body × Density of liquid × Acceleration due to gravity
When the upward force is greater than downward force body will float otherwise it will sink.If the density of body is more than that of liquid, the body sinks and if it is less than that of the density of the liquid, the body floats. So, floating of an object depends on the density of the object as well as the density of the fluid.