Whether an object sinks or floats depends on its density and the density of the liquid into which it is placed. If the object has a greater density than the liquid, it sinks. If it has less density, the object floats.
Scientists call the ability of an object to float its buoyancy. The key factor that determines an object's buoyancy is whether its molecules are densely packed together or are loosely packed. An object that has a high density, such as a lead, is going to sink because it has higher density than water, while an object with loosely packed molecules, such as wood, is able to float.