This question already has an answer here:
At the end of The Return of the Jedi, the emperor tells Luke just after Luke defeated Vader in a duel,
"Now fulfill your destiny and take your father's place at my side."
If I was Vader, I would be thinking, "Palpatine is just going to throw my life away like he did Count Dooku. I'm a goner unless I take out the emperor soon!"
The Emperor then turns his back on Darth Vader while zapping Luke with bolts of electricity. Palpatine should know not to trust Vader. He seems so engrossed in torturing Luke that he doesn't notice Vader walking up behind him and grabbing him.
He should know not to trust Vader for a second. He knows a Sith apprentice becomes a master by killing the previous master. He could have killed Luke quickly and then kill Vader, instead of spending almost two minutes torturing Luke. He also had a chance to zap Vader a couple of times when Vader was nearly helpless, lying there on the bridge before getting up to stand by his master's side. One zap to Vader's breather would probably have short-circuited it.
Why did he make himself vulnerable to Darth Vader?
Edit to address why this is not a duplicate of another question.
The other question focuses on whether Palpatine erred in torturing Luke in front of his father. Palpatine already suspects Vader's feelings for Luke.
Palpatine: Strange that I have not felt him. Are your feelings clear on this?
Vader: They are clear, my lord.
My question is about why Palpatine would trust Vader since he knows the Rule of Two. It is a Sith tradition for Sith Lords to kill their masters (or apprentices). He should know to never trust Vader for even half a second, yet he makes himself vulnerable for almost two minutes. That was all the time Vader needed to pick up the Emperor and throw him down the elevator shaft.