Deuteronomy 21:15
Laws Concerning Children
21:15 Suppose a man has two wives, one whom he loves more than the other, and they both bear him sons, with the firstborn being the child of the less loved wife.
Deuteronomy 21:17
21:17 Rather, he must acknowledge the son of the less loved
wife as firstborn and give him the double portion
of all he has, for that son is the beginning of his father’s procreative power
– to him should go the right of the firstborn.