The IRS not only taketh, but giveth. It publishes a plethora of tax tips, the most recent of which addresses what to keep in mind on income taxes and selling a home.

The tip notes, for instance, that "taxpayers who sell a home may qualify to exclude from their income all or part of any gain from the sale."

The IRS further noted some things taxpayers should keep in mind when selling a home:

Ownership and use: To claim the exclusion, the homeowner must meet the ownership and use tests. During a five-year period ending on the date of the sale, the homeowner must have:

-- Owned the home for at least two years.

-- Lived in the home as their main home for at least two years.

Gain: Taxpayers who sell their main home and have a gain from the sale may be able to exclude up to $250,000 from their income or $500,000 on a joint return. Homeowners who can exclude all of the gain do not need to report the sale on their tax return.

But what retirees, and especially widows and widowers, need to know about income taxes and selling a home is this:

"Widows and widowers often have to sell their home because the home is not practical to age in place or because money is needed to pay for retirement expenses such as long-term care," says Jean-Luc Bourdon, a wealth adviser and principal with BrightPath Wealth Planning.

In areas where real estate is expensive, he says, it's not uncommon for a widow or widower to have a home that gained more than $250,000 in value. "That person might think they have a gain above the $250,000 tax exclusion amount," says Bourdon. "But they should not forget to factor in the step-up in basis at their spouse's time of death."

To establish the new home cost-basis, he says the surviving spouse should get an appraisal at the time of death. "Often, this gets overlooked," says Bourdon. "Luckily, the home value at time of death can still be appraised years later based on historical comparable-sales data."

Also note that how title is held determines if the home gets a full or partial step-up. A home held as community property gets a full step-up in basis, says Bourdon. "So, it's particularly valuable in community property states," he says.

Another useful resource: Read Proper Asset Titling: A Critical Component of Your Estate Plan.

Got questions about money, retirement and/or investments? Email