A substance floats or sinks in another because of its relative density. Take ice floating in water for example. Water is more dense than ice so ice floats.
Mass is incorrect as the buoyancy or ability of an object to float depends on the mass per volume, which is equivalent to density.