Yang You sibling Yang Tan
During Emperor Yang's reign
Yang You was born in 605, as a son of Yang Zhao, the son and crown prince of Emperor Yang.  His mother was Yang Zhao's wife, Crown Princess Wei.  He was probably the youngest of Yang Zhao's three sons—he was clearly younger than Yang Tan (楊倓), born in 603, and probably younger than Yang Tong, whose birth year is unknown, based the order in which they were eventually created imperial princes.  However, under Confucian principles of succession, he would have been considered Yang Zhao's proper heir, as his mother was Yang Zhao's wife, while Yang Tan's and Yang Tong's mothers were concubines.
Yang Zhao died in 606.  However, Emperor Yang did not make Yang You or either of his brothers crown prince to replace Yang Zhao, leaving matters ambiguous as to whether one of them, or Yang Zhao's younger brother Yang Jian the Prince of Qi, would inherit the throne eventually.  He made the three sons of Yang Zhao imperial princes, and Yang You received the title of Prince of Dai. As Emperor Yang did not often stay in the capital Chang'an, starting 613, he made the eight-year-old Yang You nominally in charge of Chang'an, although he left the official Wei Wensheng (衛文昇) in actual charge of the city.  Later that year, when the general Yang Xuangan rebelled and attacked the eastern capital Luoyang, it was Wei who led troops from Chang'an to aid Luoyang's defenses.
In 617, the general Li Yuan, fearful of Emperor Yang because Emperor Yang had become displeased with him over his inability to defend against Tujue attacks and suspicious of him after there had been prophecies that the next emperor would be named Li, rebelled at his headquarters at Taiyuan (太原, in modern Taiyuan, Shanxi).  Li, wanting to both distance himself from Emperor Yang while declaring to the Sui forces that he was still loyal to Sui, claimed that his goal was to support Yang You as emperor and to persuade Yang Guang to return from Jiangdu (江都, in modern Yangzhou, Jiangsu) as Taishang Huang (retired emperor).  Li proceeded quickly to Chang'an, and during Li's campaign, Wei died.  Wei's lieutenants Yin Shishi (陰世師) and Gu Yi (骨儀) were left in charge of the city and guardianship over Yang You.
In winter 617, Li's forces breached Chang'an's defenses.  Li took Yang You and declared him emperor (as Emperor Gong), remotely offering Emperor Yang the title of Taishang Huang, but only territory under Li's control recognized Yang You as emperor.
brother or sister kin