How did Emperor Taizong come to rule the Tang dynasty?

He forced his father to hand over power.
He killed his living relatives to become the only possible ruler.
He exiled all who opposed his rule and defeated his political rivals.
He defeated foreign rivals and established the dynasty, becoming the first ruler.