The ruling is that when child turns seven years old then the father may keep him in his custody after talaq. He should undertake his upbringing and give him better education. The mother should give the child to his father after the child turns seven year old.
Allah knows Best!
Darul Uloom Deoband