The traditional formulation of the law of chastity is “no sex before marriage.” It’s a rule that is prohibitive instead of constructive. I believe that a more useful definition is, “a physical relationship should not outrun the emotional and social relationship.” And I believe that someone who follows the second rule will also be following the first rule.
For example, a boy and girl that have just met have a nascent emotional relationship that is weak and almost nonexistent. Therefore their physical relationship should also be almost nonexistent. Most physical contact at that stage is inappropriate. A newly-introduced boy and girl who kiss each other are breaking the law of chastity (according to my interpretation above) because their physical relationship has already been allowed to be stronger than their emotional relationship. As a boy and girl’s emotional relationship becomes stronger, they reach a point where kissing becomes appropriate, because their physical intimacy would reflect the emotional intimacy that they had already established. For each progressive step in a physical relationship, there is a corresponding emotional bond that must be forged first.
That rule applies neatly to sexually intimate contact also. Sex has the power to enmesh a couple in a life-long bond. Accordingly, their non-physical relationship should also have previously advanced to the point of a life-long commitment. The manifestation of that commitment is marriage. A couple that has sex before marriage is letting its physical relationship advance too far for its non-physical relationship. On the other hand, a couple that has sex after marriage is virtuously consummating a committed relationship.