let us be pleased with God’s Decree no matter what it contains, for no matter what it contains, His Decree brings good for the believer. Let us also thank God for the gift of faith. Faith allows us to deal with the calamities of this world with dignity and composure.
Allah Knows everything that will happen. The first thing that He created was the "pen" and He ordered the pen to write. The pen wrote until it had written everything that would happen. And then Allah began to create the universe. All of this was already known to Him before He created it. He does have absolute and total control at all times. There is nothing that happens except that He is in control of if.There is a mistake in the question: "Free Will." Allah alone, has Free Will, He Wills whatever He likes and it will always happen as He wills. We have something called, "Free choice." The difference is that what Allah "Wills" always happens and what we choose may or may not happen. We are not being judged on the outcome of things, we are being judged on our choices. This means that at the core of everything will always be our intentions. Whatever we intended, is what we will have the reward for. Each person will be judged according to what Allah gave them to work with, how they used it and what they intended to do with it.