It has been narrated on the authority of Aba Sa'id al-Khudri that the Messenger of Allah (ﷺ) said: When oath of allegiance has been taken for two caliphs, kill the one for whom the oath was taken later.
Hadith ReferenceSahih Muslim / The Book on Government / Hadith: 1853