Scripture does not say that the earth is no more than 6,000 years old, but in the beginning (doesn't say when that beginning was) the earth "was", and at that time the earth was formless, dark and empty.
Genesis 1:1 In the beginning God created the heavens and the earth. 2 Now the earth was formless and empty, darkness was over the surface of the deep, and the Spirit of God was hovering over the waters.
The first thing God did to it was put goodness in it, and scripture translates that Hebrew word meaning goodness as light. The sun and moon, or light as we think of it, wasn't created until the third day.
That when scripture starts speaking of the people of the earth.