From what you say it sounds like the Chicago house has been your grandparents primary residence for at least 2 of the last 5 years, but it has not been your parents primary residence for any time in the last five years. It sounds like the Arizona house has been your parents primary residence for at least 2 of the last 5 years, but it has not been your grandparents primary residence for any time in the last five years.
If you're saying your parents and your grandparents each own half of each house, then it would seem your grandparents can exclude up to $500k of the gains on the sale of the Chicago house and your parents can exclude up to $500k of the gains on the sale of the Arizona house.
Given this 50/50 arrangement your parents (Chicago) and your grandparents (Arizona) will have to pay taxes on the gains from the sale of the homes that were not their primary residence and on any gains in excess of $500k on the homes that were their primary residence. Capital gains on the sale of a home that aren't excluded as a primary residence are just like any other capital gains you might have (such as a taxable account).
Unless your parents want to move back to Chicago for two years that's a done deal, so they'll be paying their half of the gains there. Something they could consider is having your grandparents move to Arizona and waiting to sell the Arizona house for at least two years after the sale of the Chicago house. That way your grandparents could exclude the gains on the sale of both houses. Note that they'll need to both be living their as a primary residence for at least two years and it must have been at least two years (to the day) since the Chicago house sold.
Since at least your parents, and possibly your grandparents will probably be paying tax on the capital gains it would be worth looking back through their records and see what they can cobble together to increase the cost basis of the homes. Obviously the original purchase price counts, so do capital improvements to the house, but not repairs. The broad strokes difference is an improvement is something that adds value to the house while a repair just fixes something that wore out. Obviously there is lots of grey area there, so take a look at the link below.
For the official source on all of this (including a good list of "Examples of Improvements That Increase Basis" on page 9) see
Publication 523.