The Emperor never intended to die:
I'm looking forward to completing your training. In time you will call
me Master.
He taunts Luke in order to get Luke to give in to his anger and turn to the dark side:
Good. I can feel your anger. I am defenseless. Take your weapon!
Strike me down with all your hatred, and your journey towards the dark
side will be complete.
It's at that point that Luke attempts to strike the Emperor but Vader blocks him.
From the Emperor's perspective, the outcome of the resulting duel will either be
- Luke turns to the dark side, and the winner becomes (or continues to be) the apprentice (Luke or Vader).
- Luke remains with the light side, and either Vader or the Emperor himself kills him. Vader remains the apprentice.
The optimal result for the Emperor is that Luke replaces Vader as the apprentice:
Good! Your hate has made you powerful. Now, fulfill your destiny and
take your father's place at my side!
Hence the Emperor's taunting Luke, again to induce Luke to give into his anger and turn to the dark side. The Rule of Two would still be followed, but the Emperor would gain a younger, healthier apprentice (much like he had replaced the aging Dooku with a younger Anakin).
Unfortunately for the Emperor, Luke did not turn to the dark side and defeated Vader. This by itself was not a problem for the Emperor, who was able to unleash Force Lightning against Luke and (nearly) kill him without drawing his lightsaber. Had Vader not intervened, Luke would have died and Vader would have still been the apprentice.
From Vader's perspective, this was his chance to kill his master and become the new Sith Master, with Luke as his apprentice. Vader also needs Luke to turn to the dark side (and help him kill the Emperor), so Vader goes along with the Emperor's attempts to induce anger in Luke.