Xiao Gang was born in 503, as the third son of Emperor Wu. His mother Consort Ding Lingguang (丁令光) also gave birth to Emperor Wu's firstborn son and crown prince Xiao Tong, and therefore carried a special status within his palace even though she was never empress. In 506, at the age of three, Xiao Gang was created the Prince of Jin'an. As he grew in age, he was given a number of progressively higher offices. In 526, when Consort Ding died, he resigned those offices to observe a mourning period for her, but Emperor Wu restored him to those offices before the mourning period was over.
Consort Ding's death would bring about a disastrous effect in the relationship between Xiao Gang's father Emperor Wu and Xiao Gang's brother Xiao Tong. Xiao Tong sought out an appropriate place to bury Consort Ding, but while he was doing so, a land owner bribed the eunuch Yu Sanfu (俞三副) into convincing Emperor Wu that that piece of land would bring good fortune for the emperor, and so Emperor Wu bought the land and buried Consort Ding there. However, once Consort Ding was buried, a Taoist monk informed Xiao Tong that he believed that the land would bring ill fortune for Consort Ding's oldest son—Xiao Tong. Xiao Tong therefore allowed the monk to bury a few items intended to dissolve the ill fortune, such as wax ducks, at the position reserved for the oldest son. Later on, when one of Xiao Tong's attendants, Bao Miaozhi (鮑邈之), was squeezed out of Xiao Tong's inner circles by another attendant, Wei Ya (魏雅), he, in resentment, reported to Emperor Wu that Wei had carried out sorcery on Xiao Tong's behalf. When Emperor Wu investigated, waxed ducks were found, and Emperor Wu became surprised and angry, and wanted to investigate further. He only stopped the investigation when he was advised to do so by the prime minister Xu Mian, executing only the Taoist monk who had suggested the burial of wax ducks. Xiao Tong became humiliated in the affair, and was never able to clear himself completely in his father's eyes.
Xiao Tong died in 531. Under Confucian rules of succession, his oldest son Xiao Huan (蕭歡) the Duke of Huarong was expected to succeed him as crown prince, and Emperor Wu summoned Xiao Huan back to the capital Jiankang in order to do so. However, still resentful over the wax duck affair, he hesitated for days without carrying out the creation, and finally did not do so. Instead, against popular opinion, he created Xiao Gang, his then-surviving oldest son, crown prince. Xiao Gang's staff advisor Zhou Hongzheng (周弘正) wrote a memo to Xiao Gang advising him to decline the creation, but Xiao Gang did not do so, although he subsequently avenged Xiao Tong's disgrace by executing Bao Miaozhi.