You are both correct. You must first look at the number of days. The parent that has over 50 percent of the time is the custodial parent and gets the deduction. The income rule is the tie breaker if the number of days are equal.
Any individual seeking legal advice for their own situation should retain their own legal counsel as this response provides information that is general in nature and not specific to any person's unique situation. Circular 230 Disclaimer - Advice given in this response cannot be used to eliminate penalties with the IRS or any other governmental agency.
Under IRS rules, the parent that has the child the majority of the year gets the exemption. Honestly, though, your decree should be amended to provide for who gets it - alternating is a typical provision. If you both claim the exemption on separate returns, you'll both get audited.
This answer is not to be considered a response to a specific legal issue in a specific jurisdiction - it is to be considered only a general response to a hypothetical scenario posed by the questioner. For specific legal advice, please consult with a licensed attorney in your jurisdiction.
Sign up to receive a 3-part series of useful information and advice about child custody law.