Claiming dependents

Next year my child’s mother and I will start trading off on who can claim her as a dependent.  We now split her time 50/50. 
I usually claim 2 on my federal for the past 6 years she has lived with me.  I noticed I claim 1 on my state; I’m not sure why they’re different. Maybe I forgot to change them both to 2. 
Can or should I adjust my w4 every year now? 
I want to maximize my take home pay without owing money at tax time. 
What should I be claiming, for both federal and state?