Deuteronomy 21:16

and if he wishes to divide his substance among his sons: he cannot make the son of the beloved wife the firstborn, and so prefer him before the son of the hated wife

Other versions

King James Version

Then it shall be, when he maketh his sons to inherit that which he hath, that

English Standard Version

then on the day when he assigns his possessions as an inheritance to his sons, he may not treat the son of the loved as the firstborn in preference to the son of the unloved, who is the firstborn,

New International Version

when he wills his property to his sons, he must not give the rights of the firstborn to the son of the wife he loves in preference to his actual firstborn, the son of the wife he does not love.