Capital gains on house sale

I have owned a home for the last 25 years that I raised my family in.   I moved to another home about two years ago; however, my son and granddaughter live in the home.   Am I sheltered from capital gains tax on sale of the home as long as my son stays in residence?   Or does it depend on my residence?