An object floats or sinks in a liquid, depending on its volume density.
Water has a density = 1 gm/cc.
If any substance with density more than 1 gm/cc is placed on the surface of water, then the object will sink. If the density is less than 1 gm/cc, then the object will float on the surface of water. The object is not completely immersed in water.
If the density of water and object are equal then the object is just completely immersed but still floating on the surface of water.
There is a force called buoyancy force, which Archimedes had discovered. The weight of the liquid displaced by the object is equal to the buoyancy force on the object. It acts upwards. If the weight of the object is more than the buoyancy force, then it sinks.