You don't input the child that you are not claiming as a dependent. Because your ex has the majority custody, she is the custodial parent of both children. So, she enters both children each year (unless the physical custody changes). She will indicate that you are claiming one of the children as a dependent.
Because you are not treated as the custodial parent, there would be no reason to enter the child you are not claiming as a dependent. For the child you are claiming as a dependent, be sure not to indicate more than 5 months of living with you. The benefit of being the custodial parent goes with her, so your indication of the "months" shouldn't conflict with that. The IRS doesn't see the months you input, but the program might trigger custodial benefits if you put more than 5 months. You can put 4, 5...whatever... just leave it there.