In most states, nonmarital sexual relations are not supposed to be a factor in deciding custody unless it can be shown that the relationship has harmed or is likely to harm the child.
For example, if one parent has had a discreet affair during the marriage, that normally would not be a significant factor in deciding custody. Similarly, if after the marriage is over, a parent lives with a person to whom he or she is not married, the live-in relationship by itself normally is not a major factor in deciding custody. In the case of live-in relationships, the quality of the relationship between the child and the live-in partner can be an important factor in a custody dispute.
Having sex with another adult can be a negative factor, however, if the parent’s sexual relationship has placed the child in embarrassing situations or caused significant stress to the child. In one case, for example, the mother had on a number of occasions engaged in sex with a neighbor while her child was home. After the wife of the neighbor appeared at the door one day and demanded that the child tell her what the adults were doing in the bedroom, the mother lost custody primarily because of her sexual relationship and its impact on the child.
SOURCE: American Bar Association