The Inner Planets dense and rocky because they are close enough to the sun that the heat has driven off the free hydrogen and helium which forms most of the Gas Giant planets (and most of the universe). Only the heavier elements remain.
And please put the questions in right subject. It belongs to "Physics" not for "Biology".
Hope this helps!