The court shall determine legal custody, residency and parenting time of a child in accordance with the best interests of the child.