Allah knows who will be in Hell and Heaven as per our deeds but we don’t. If Allah puts good people in heaven and bad people in hell; then who are in heaven will not complain but people who are in hell will complain and may disagree with his descision.
So he created world so that we are witness to our deeds. Allah is Just and All Knower and is mentioned in Quran What he knows we don’t know…