Weight of the body = W = downward force acting on the body 
weight of liquid displaced by the body when completely inside the liquid = w = Buoyant force of 
the liquid acting on the body upward 
If (1) W > w , the body sinks 
(2) W < w , the body floats 
(3) W = w , the body remains in equilibrium inside the liquid. 
When the density of the liquid is greater than that of the object, condition (2) is satisfied and hence 
the body floats.