I think it’s important that we remember that all-knowing is not just knowing everything that is, but knowing everything that could be. I look at it this way, God before choosing to create the universe, could look to the future and see every possible outcome, from the most mathematically perfect, but non-life sustaining universe, all the way to the most ludicrously chaotic and treacherous universe. Being omniscient, He knew even before he created the universe, exactly what he needed to do to make it to His vision, no “corrections” would be needed later.
Likewise, He knew we would be the result from the very beginning. But since He allows us free will, making us co-creators of the past, present, and future, He doesn’t just see what we will do. He witnesses every choice we could do. From the mundane choice of which color socks we’ll wear today, all the way to soul-shattering or saving decisions. Now, it must be remembered that the future doesn’t exist yet, so the Lord isn’t looking at what we absolutely will do, but at maybes. That said, He knows us better than we know ourselves, so He knows what choice we’re likely to make. And this extraordinary and supernatural knowledge forms the basis of His decisions on how to interact with us.
Since he can see every possible combination of events that could ever occur, he witnesses our lives, the lives of those yet born, and even the lives of those who will never know life. Both as they could be, as well as what they really are. I think this is why God allowed us free will in the first place, He saw how unutterably beautiful our relationship with him could be, and even knowing how appallingly terrible things might become, He couldn’t pass up the chance, however small, to see that relationship realized.
tl;dr
God sees every possible outcome in history and thus knows us completely, to the point of knowing us as the lowest of sinners and the most illuminated of saints. Even before we come into the world.