When did your ex take temporary custody ?
The parent that provided more than half the support of the child during 2012 gets to claim him.