The rule of 2 meant an apprentice took an apprentice and the two would over throw the master. That's why Dooku brought Anakin to the dark side.
If the master found someone stronger than current apprentice, that's the new apprentice.
So there were "only two"...
But they probably both had constant feelers out. Both for potential allies and rivals. An apprentice might have dozens of potentials out there that they're talking to and tempting with power, hoping one gets strong enough to kill the current master.
That's how the rule is passed down, every apprentice to a master either killed the last master with the last apprentice, or killed the last apprentice because "there can be only two".
I think:
Dooku saw that Anakin would quickly surpass himself. Even if he used Anakin to overthrow Palpatine, Anakin would immediately take out Dooku by gaining any competent apprentice. But if he just ignored Anakin, Palpatine would (and this is what happened) just replace Dooku with Anakin.
So after Dooku realized he couldn't control Anakin, he knew that he had to kill Anakin immediately because he was constantly getting stronger and Palpatine had almost certainly found him.
Palps tho had a hidden endgame, he wanted the strongest force user's body to put his own mind into. He wasn't afraid of Anakin's raw but untrained power, that was exactly what he wanted. Until Obiwan chopped off 3/4s of his body, ruining him as a host.
It can be rationalized, but I doubt Lucas did it intentionally.