Get your taxes done using TurboTax

can a judge give a parent that only gets the kids 2 months of the year the right to claim them on their taxes when other parent has them for 10 months of the year ? Mom wants to claim children but only gets them for the summer while children live all year round with dad. Is this even legal ?