As far as Satan and Hell go.Why didn't god being all knowing, know that satan and a 1/3 or his/her army would rebel? Is this part of his plan?

And do people have freewill in Heaven?