God knows what will happen, but not who will do it. The universal drama has a script that is decided by God’s will and then who wants to play which role is decided by the soul.
You can understand this in terms of economics. The market size is fixed but the actors in the market are free. The market size is simply the total number of transactions of giving and taking. Just like someone will borrow money from a bank and some bank will lend. The total amount of money borrowed and lent is fixed. But that doesn’t mean which bank will give to which borrower is fixed. God’s omniscience and control are about what will happen, not about who will do it. In terms of history, you can say that there will be someone who will do bad things and someone who will do good things, and the count of these good and bad deeds are fixed. But actors are not.
There is a scientific basis for this answer which I have discussed in a paper entitled “Choices in General Relativity”. The universe of events is fixed but the actors are not fixed.
You are basically posing the free will vs. determinism problem but you are giving it a theistic color by saying determinism is God’s foreknowledge. This is making things seem more complicated. You can remove God from this, and then you are plain and simple talking about determinism. Once you understand how free will is compatible with determinism the determinism created by God’s will be compatible with the free will of individual choices.