Double lesson cannot be over certain breaks
In most cases the best solution is to define breaks between lessons. By default your double lessons cannot span over these breaks.
See here:
How can I print breaks between lessons?
Certain longer lessons can be over all breaks
However in some cases you need more precise specification. Using this cardrelationship you can precisely define which subjects, what days, lessons etc:
Adding this constraint will prevent any double lesson from crossing the break between 2nd and 3rd period, but only on Wednesday-Friday:
Note the "opions button" where you can define that this cardrelationship shall only consider double lessons.