Did God always know that Lucifer would rebel against God?
A) God Knows The End From The Beginning
Isaiah 46:9-10 KJV
 Remember the former things of old: for I am God, and there is none else; I am God, and there is none like me,  Declaring the end from the beginning, and from ancient times the things that are not yet done, saying, My counsel shall stand, and I will do all my pleasure:
B) His Understanding Is Infinite
Psalm 147:5 KJV
 Great is our Lord, and of great power: his understanding is infinite.
C) God Knows All Things
1 John 3:20 KJV
 For if our heart condemn us, God is greater than our heart, and knoweth all things.
D) God Knows Everything Before It Happens.
Because of His foreknowledge.
Acts 2:23 KJV
 Him, being delivered by the determinate counsel and foreknowledge of God, ye have taken, and by wicked hands have crucified and slain:
So the answer is yes, God knew that Satan would fall.
But then you might ask, “Why would God create Satan if he knew he would fall?”
First, we need to remember that God created Satan perfect;
Ezekiel 28:14-19 talks about Satan when he was created and was “the anointed cherub….” verse 14, who was created by God perfect, “Thou wast perfect in thy ways from the day that thou wast created, till iniquity was found in thee.” verse 15.
Second, we need to know that it wasn’t God’s fault Satan rebelled and sinned, it was Satan’s pride. He desired to be like God and overthrow Him. See Isaiah 14:12-17.
So yes, God knew Satan would sin, but God created Satan with a free will to either love God or not. Just as God creates mankind with a free will. Any being who isn’t created with a free will is more like a mindless robot who cannot show love willingly.
John 14:15,21 KJV
 If ye love me, keep my commandments.  He that hath my commandments, and keepeth them, he it is that loveth me: and he that loveth me shall be loved of my Father, and I will love him, and will manifest myself to him.