Modify this to sound more formal:
he had a 4 month affair w/her and slept w/her then would come home to me.
He had been engaging in sexual contact with her during an affair of a four month duration while returning home to me.