From Configuration → Settings → Course-related settings → tab Classroom management there is a checkmark Enable Substitute Assignment:
From the course tab you will now be able to see and enable the check mark Enable substitute assignment:
From now on by going to Modify In a lesson, either from lesson agenda or from the general calendar system, it will be possible to select any any alternative lecturer.
The classes for which this will be done, will be identified with a "substitute" label, both in the class agenda and in the calendar.
To change the teacher of a lesson follow this guide.