The Holy Prophet did not nominate a successor. On the death of the Holy Prophet, Abu Bakr was elected as the Caliph. According to some accounts it appears that Ali did not offer allegiance to Abu Bakr, and that he offered such allegiance after six months when Fatima had died. According to other accounts, Ali offered allegiance to Abu Bakr soon after his election.
After Abu Bakr, Umar became the Caliph. During the caliphate of Umar, Ali was a member of the Majlis-i-Shura, and he fully cooperated with Umar