Well, its answer is very simple. Watermelon does not sink in the water due to some simple reasons. First of all it has the air in it. So when a thing has some air in it and the that thing is also air tight i.e there is no way from where air can leak than that thing would totally behaves like a tube. I meant to say from tube is swimming tube. If you'd put the tube of some tire of a car while it is full of air it would not sink as well. And that is the same case which is applied on watermelon. Watermelon also has air in it and the air has no way to come out from it until you'd cut it. So if you'd cut it it will sink in the water. That is the reason due to which watermelon does not sink in the water and it keeps floating on the surface of water. I hope you've understood the reason because of which watermelon floats on water. Thanks for asking.
Yea but it also depends on how hevy it is vs how much air it has
An expansion on the preceding answer: If the average density of a water-tight watermelon is less than that of fresh water(which is about 1.0 gram/cubic-centimeter or 62 lbs/cubic-ft). If the hollowed identical shape of a watermelon were filled with fresh water it would be a bit heavier than the solid watermelon.
It has air pockets
An object which weighs less than the weight of water it displaces will float.
The watermelon has a density of 150 kilograms/cubic meter, but water has a density of 1000 kilograms/cubic meter, so it floats.