House was not rented. Her son lived there for a time and just paid the utilities used. No income was generated from his stay.
She will be exempt, on up to $250,000 in capital gains. Even though she has been in a nursing home, the house is still her principal residence for the purposes of the home sale exclusion.
Reference: https://www.irs.gov/publications/p17/ch15.html; which says "Under this exception, you are considered to live in your home during any time within the 5-year period that you own the home and live in a facility (including a nursing home) licensed by a state or political subdivision to care for persons in your condition"
Q. Does she still need to pay the taxes on the remainder of proceeds?
A. Yes, if her capital gain is greater that $250,000, she will pay income tax at capital gains rates on the excess (the gain over $250,0000). Using the money to pay nursing home, or other medical expenses, does not matter (other than that she may be able to claim itemized medical deductions).
@jrockage all the above is assuming that the house was never rented out or used for any other business purpose while she was in the nursing home. If these assumptions are correct, then she qualifies for the $250K capital gains tax exclusion.
If she was married and her spouse was living in the house with her (or considered living "with her") then there's a way to get the $250K exclusion for both. I myself am not privy to that method and will not try to cover that here unless we know "for a fact" that this is the case. It's complicated.
Using an example: Grandma & grandpa bought a house in 1960 for $50,000. Grandpa died in 2000 when the house was worth $200,000. Grandma's cost basis is now $125,000 (half of $50,000 + half of $200,000). If they lived in a community property state, the cost basis becomes the full $200,000.
There is a condition stated before the exception you quote. It says the exception applies
You owned and lived in your home as your main home for a total of at least 1 year during the 5-year period before the sale of your home."
It appears that if you were out of the home more than 4 years before the sale, you don't qualify for the exception.