In Exodus 21:2-6
a master could give his servant a woman to temporarily marry as long as he works for the master. When the servant discontinues working for the master the marriage ends as a standard term and condition of this arrangement. The child custody belongs to the master.
It is important to understand how great a influence on society these Pastors who claim you should believe the Bible but lie about what it teaches about marriage and gender roles have. Most Pastors are liars