Jeremiah 1:5 and Romans 9:10-13 describes the soul having a history before being placed in the flesh.
You might review that. God views everything outside of the restriction of time, and thusly would know someone before they were born (in relation to time). It doesn't mean the soul has a history prior to human birth. It just means God can see the birth and person and their actions before they occur in time.
That is how God is able to send word to the king of Babylon through his prophet Isaiah in writing 150 years before the man named in the writing becomes king of Babylon and name him by name as well as telling that king of his accomplishments and what he should do now that he rules Babylon.. Being outside of time allows you a perspective no on else could have.
Isa 57:15 For thus saith the high and lofty One that inhabiteth eternity, whose name [is] Holy; I dwell in the high and holy [place],
The mind of God conceived our reality before He executed it by creating our time domain. He knew all who He would create before He injected the information into our time domain. The physical non-eternal, as well as the massless identity that is our created eternal soul.
Information is massless, yet once conceived and imprinted on hardware becomes a reality, as with a program burnt on a CD. Like God we can conceive and make use of organized intelligent information (made in His image).
Can a programmer know what he will program before he makes it a reality? Nothing becomes a reality without God's approval. The free souls He created that can also create ideas and make use of them, is a chance He chose to take. The consequences related to that freedom has been accepted before He executed His creation. Hence the Lamb slain before the foundation of the world. The eternal significance of the cross will not be understood until we reach the other side.
Therein lies the confusion of Calvinists. They have trouble reconciling the sovereignty of God with the free will of man. Therein also lies the problem for evolutionists. They do not understand how God is outside of time and our reality is but a stationary canvas to Him.
The Father in eternity can know the day or the hour, but the Son who is constrained by having been injected into our time domain cannot. In the same way, God in eternity can know us before we are physically conceived and yet we are not created until He injects us into that physical hardware.