Deuteronomy 21
15 Ref If a man has two wives, one greatly loved and the other hated, and the two of them have had children by him; and if the first son is the child of the hated wife:
16 Ref Then when he gives his property to his sons for their heritage, he is not to put the son of his loved one in the place of the first son, the son of the hated wife: