Right here.
But it's written in archaic Danish though:
https://www.retsinformation.dk/Forms/R0710.aspx?id=45894
And summarized very briefly and simplified:
§1 - In case the Monarch is absent (sick, insane, away from the country or disappeared, held captive and so on) the Heir takes over as Regent.
If the Heir is a minor, or also absent or otherwise unable to take over, the State Council will immediately call a session in the Parliament in order to appoint a Rigsforstander.
The Parliament will also be called in to determine whether the Heir should take over as Regent on a more permanent basis.
§2 - If there is a risk of the Monarch dying before the Heir comes of age, the Monarch will together with the Parliament appoint a Rigsforstander, who will act on behalf of the Heir until he/she comes of age.
§3 - The same thing applies if the Heir dies while still being a minor, but while a Rigsforstander is appointed. The the oldest child of the Heir will become King. (Monarch).
(The old system with the king is dead, long live the king still applies. The Heir automatically becomes king, but cannot rule until he/she is an adult.)
§4 - If the Heir is abroad when the Monarch dies, the Parliament will state a certain time period within which the Heir must return and at the same time decide whether a Rigsforstander is to be appointed.
(Beforehand it could take weeks even months to return to DK. Nowadays Frederik can be back in DK within 24 hours. If not the Parliament will simply appoint Joachim as Rigsforstander until Frederik returns.)
§5 - The Rigsforstander must be a Prince in line to the throne
or an adult man, who belongs to the Lutheran church and is a Danish citizen.
(Today a Rigsforstander can be a woman.)
§6 - No one can act as Rigsforstander until he/she adheres to the §7 in the Constitution. - That means signing a pledge to obey the Constitution.
§7 - Constitutionally speaking a Rigsforstander acts as the monarch in anything but name and also enjoys the same immunity as the monarch. The ministers are responsible for the country being run by a government.
§8 - If the Rigsforstander cannot, is unable to, will not act or steps down, the Parliament will immediately appoint a new Rigsforstander.
§9 - In case there is no Rigsforstander in place or in periods where the Rigsforstander no longer functions, the State Council will temporary acts on behalf of a Rigsforstander until a new one is appointed.
(Denmark must never be without a head of state or someone acting on behalf of the head of state - not even for a minute. Because constitutionally speaking all authority is enacted on behalf of the Monarch or on behalf of the Regent or Rigsforstander who acts on behalf of the King. That includes the government who govern on behalf of the Monarch. No Monarch, no government. That's why there is
always the Regent or Rigsforstander in place when QMII is abroad for more than a day - and it gets interesting when her plane is grounded due to bad weather as we experienced recently.)