Understanding competing charge density wave (CDW) orders in the bilayer kagome metal ScV6Sn6 remains challenging. Experimentally, upon cooling, short-range order with wave vector $${{{{\bf{q}}}}}_{2}=(\frac{1}{3},\frac{1}{3},\frac{1}{2})$$
q
2
=
(
1
3
,
1
3
,
1
2
)
forms, which is subsequently suppressed by the condensation of long-range $${{{{\bf{q}}}}}_{3}=(\frac{1}{3},\frac{1}{3},\frac{1}{3})$$
q
3
=
(
1
3
,
1
3
,
1
3
)
CDW order at lower temperature. Theoretically, however, the q2 CDW is predicted as the ground state, leaving the CDW mechanism elusive. Here, using anharmonic phonon-phonon calculations combined with density functional theory, we predict a temperature-driven structural phase transitions from the high-temperature pristine phase to the q2 CDW, followed by the low-temperature q3 CDW, explaining experimental observations. We demonstrate that semi-core electron states stabilize the q3 CDW over the q2 CDW. Furthermore, we find that the out-of-plane lattice parameter controls the competing CDWs, motivating us to propose compressive bi-axial strain as an experimental protocol to stabilize the q2 CDW. Finally, we suggest Ge or Pb doping at the Sn site as another potential avenue to control CDW instabilities. Our work provides a full theory of CDWs in ScV6Sn6, rationalizing experimental observations and resolving earlier discrepancies between theory and experiment.