Deuteronomy 21:15-17 King James Version (KJV)
15 If a man have two wives, one beloved, and another hated, and they have born him children, both the beloved and the hated; and if the firstborn son be hers that was hated:
16 Then it shall be, when he maketh his sons to inherit that which he hath, that he may not make the son of the beloved firstborn before the son of the hated, which is indeed the firstborn:
17 But he shall acknowledge the son of the hated for the firstborn, by giving him a double portion of all that he hath: for he is the beginning of his strength; the right of the firstborn is his.
Deuteronomy 21:15-17 New International Version (NIV)
The Right of the Firstborn
15 If a man has two wives, and he loves one but not the other, and both bear him sons but the firstborn is the son of the wife he does not love, 16 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. 17 He must acknowledge the son of his unloved wife as the firstborn by giving him a double share of all he has. That son is the first sign of his father’s strength. The right of the firstborn belongs to him.