When Ali was born...
When Ali was born, Muhammad, the future Messenger of God, came into the precincts of the Ka’aba to greet him. He took the infant into his arms and dedicated him to the service of Allah. In a nutshell, birth in Ka’aba was one of many distinctions that God bestowed upon Ali. Another distinction that he enjoyed was that he never adored the idols. This again makes him unique since all Arabs worshipped idols for years and years before they abjured idolatry and accepted Islam.
His Upbringing Ali was brought up by the Messenger of Allah (peace be upon him and his family). Abu-Ṭālib, who was the guardian of Muhammad as a child, had many children. In order to relieve him during a difficult year for Quraysh, Muhammad took Ali and Abbas took Ja’far. He was in the house of the Messenger of Allah (peace be upon him and his family) since his childhood and he was considered a child to him.
According to the famous narration, he reached the age of ten or twelve years old when the Messenger of Allah (PBUHH) was appointed as a Messenger of Allah.