Deductions & credits

If the deed did not specify a percentage of ownership, then the default is 1/3 each.

The sellers owe capital gains tax on the gain from the sale.  Your cousin who lived there can use the gains exclusion for a personal residence but the two other owners can't, and owe tax on their part of the gain.

The gain is the difference between the cost basis and the selling price.  If the home was gifted by simple deed, then the three new owners each get 1/3 share of ownership and 1/3 of the cost basis.  They get the cost basis of the person who gave them the home -- that is, the selling price or other cost basis of the previous owner.  That would be the price your aunt paid whenever she bought the home.  It might also be adjusted if she owned the house with a spouse who predeceased her.  The cost basis is also adjusted by any permanent improvements such as remodeling costs.  But as this was a long time ago, you may have a difficult time documenting the cost basis and adjustments.  You can probably find the price she paid in county records, and if it was owned by a spouse, there is a partial adjustment based on the fair market value when the spouse died, which can be determined from old real estate records.

Under the basic tax rules, the two grandsons owe gains tax on their 1/3 of the gain.  If they had signed quit claim deeds to give the house to their mother before she sold it, then they would not be owners and would not be responsible.

There might be some way to say that even though the grandsons were owners in name but not in fact and should not have to pay the tax.  You would probably need to talk to a tax professional.  The default assumption is that the two grandsons will owe capital gains tax on their part of the gain.