There was a great post on this subject by Tim Urban: https://waitbutwhy.com/2015/03/7-3-billion-people-one-buildi...
Even accounting for the human body not occupying all of the space in the rectangle/box he uses (thus allowing for more people to fit a la fitting people in a phone both), his math is simply wrong.