Even sex within the sacrament of marriage has been (and remains) problematic in the Church. Do it only for religious reasons. Do it (only) to make babies. Don't do anything while you're doing it to prevent pregnancy. Don't do it just because it feels good. Do it whenever (and however he wants it). Don't do it that way. Don't tell anyone you do it that way. Don't enjoy it (at all or not too much) if you're a woman. Don't do it if you're menstruating. Don't do it if you're pregnant. Don't call forcible intercourse rape.
The rules for unmarried people are all the above, plus just don't do it.
Is that (really) what the bible (really) says? Is that (really) what it (really) means?
Interestingly enough, there are loopholes. For men. And to some degree for the women who meet their needs.
Only married and marriageable women are required to be celibate or chaste. And only Israelite women and girls are officially marriageable. There is even a marriageability continuum: never-married virgin girls are most marriageable and sexually experienced women or girls - rape victims, widows and divorced women are least marriageable. Prepubescent non-Israelite girls are less marriageable than prepubescent Israelite girls, but more marriageable than sexually experienced Israelite women or girls.
An Israelite man - including married men - could have sex with a widow, divorced woman, rape-victim or foreign woman or girl with impunity. Only sex with another man's wife was considered adultery. Sex with an Israelite's marriageable daughter was also punishable. A woman who had sex with a man to whom she was not married reduced her marriageability quotient. And a married woman who had sex with a man other that her husband was an adulteress. (One overlooked aspect of Jesus' teaching on divorce and adultery was that he expanded the Torah to restrict Israelite men's sexual access.)
This loophole for men is revealing. Men who reported and recorded their experiences of and with God - or claimed them, interpreted, preserved and canonized them did not hear or experience (or report or preserve) God as saying that women had the same sexual needs as men. Perhaps God said so and they could not hear or understand God. Perhaps God said so and they ignored God. What would the scriptures have said if women were their primary (or sole) producers, preservers, interpreters and proclaimers. These men did hear God say something that meant a single sexual partner over a (much shorter) lifetime was inconceivable for them.
The ancient practice of marrying off teenagers as soon as they reach puberty - not reproductive maturity, but the first blush of sexual desire - bears witness to the strength of sexual desire.
How can the church, synagogue and mosque live fully in the present era guided by our holy texts?
We must stop pretending. We must stop pretending that we still live in the Iron Age. We must stop pretending that women are fundamentally different from men. We must stop pretending people don't have and want to have sex. We must stop pretending that we don't know sex is good.