From about the fifth century BCE, commentaries (shastras) on the dharma proposed the idea that people move through four stages of life (ashramas): student (brahmacharya), householder (grihastha), retiree (vanaprastha), and ascetic (?). Here the belief is that correct practice and behavior is not only informed by a person’s varna (caste or social class) but also by what stage he or she is presently in.
Not everyone can transition through the four ashramas. Women, members of the worker class (shudras), and the untouchables (dalits) were excluded. By contrast, men from the top three classes/varnas, such as the priests (brahmin), soldiers and warriors (kshatriyas), and merchants and farmers (vaishyas) were able to go through all four ashramas.
The first ashrama, the student stage, has the boy attend a school to study literature, in particular the Vedas (Hinduism’s sacred texts) under a teacher (guru). Up until the age of between 25 and 30, students at the school would learn about the correct way to live (right living), as well as study philosophy, law, history, grammar, and rhetoric. The students were expected to abstain from sex, focus entirely on learning, and have respect for their parents and teachers. When the student stage was completed, the man is then expected to marry and have a family.
The third stage is the withdrawal or retirement often beginning when the arrival of the first grandson. It initially involved the man becoming a forest dweller who must cease having sex. In contemporary India where this ashrama is embraced, it refers more generally to withdrawing from responsibilities over the business and financial matters. This withdrawal allows for the next generation to begin taking over the responsibilities while also continuing their studies. This stage is also a time for the man to give advice to others and reflect on life. Most Hindus do not pass this stage to become ascetics, usually because this requires he has sorted out all of his duties and obligations to the family.
If the man does become a wandering ascetic, he fully sets aside worldly concerns and attachments to devote himself to pursuing final release (moksha).
But the ashramas are certainly not liked by all. It seems to disallow women and those who are not from the top three classes equal opportunity to pursue the spiritual life and/or become financially independent. In matters of marriage, there can often be no real romantic attachment because they are often contracts between families, which can cause difficulties if the couple is not well-suited for each other or are distinctive in their varna.
Ambalu, S. 2013. The Religions Book. London: DK. p. 107-109.