One verse

Srimad Bhagavatam 11.18.12

11.18.12

यदा कर्मविपाकेषु लोकेषु निरयात्मसु । विरागो जायते सम्यङ् न्यस्ताग्नि: प्रव्रजेत्तत: ॥ १२ ॥

yadā karma-vipākeṣu lokeṣu nirayātmasu virāgo jāyate samyaṅ nyastāgniḥ pravrajet tataḥ

yadā
when
karma
by fruitive activities
vipākeṣu
in all that which is obtained
lokeṣu
including promotion to all the planets of the universe up to Brahmaloka
niraya-ātmasu
planets that are actually hellish, being material
virāgaḥ
detachment
jāyate
is born
samyak
completely
nyasta
giving up
agniḥ
the sacrificial fire of vānaprastha
pravrajet
one should take sannyāsa
tataḥ
at that point

If the vānaprastha, understanding that even promotion to Brahmaloka is a miserable situation, develops complete detachment from all possible results of fruitive activities, then he may take the sannyāsa order of life.