The court bases custody determinations on what is in the best interests of the child. ythis most often includes an evaluation of a custody evaluation, a psychological evaluation and more. There is undoubtedly some basis for the court's ruling and you have provided very little information in your post.
If the Court has entered its order, you have one option --appeal. You must have a basis for tha appeal and any appeal would have to argue that a mistake of law was made or that the court abused its considerable discretion in making its determination.