So why did Jesus tell the woman that she has had five husbands, and the man she has now is not her husband if sleeping together meant they were married?
Marriage is a promise. Many people sleep together without making that promise, while some (like me) made that promise before sleeping together, and we considered ourselves married before our "wedding" ceremony.