Teacher can teach max 5 lessons per day, but only twice in week
This can be done with using these two constraint.
1. At first set, that teacher can teach max 5 lessons per day. You can do so in teacher's constraint
How to specify min and max lesson teacher shall have on one day?
or with this advanced card relationship
2. Now set that teacher can have max 4 periods per day with two exceptions. It will mean, that these two days teacher can teach max 5 periods, which were set in first step.