Substitution groups are established on the element declaration via the 'substitutionGroup' attribute.
The value is a QName of the element for which this element can be substituted.
The only restriction is that the element's type must be derived from the type of the substituted element. That is, the type of 'student' must be derived from the type of 'person' (which it is).
So, each of the elements student, parent, teacher in the schema should have a substitutionGroup attribute with a value of 'my:person'.
The fixed teacher.xsd should valid this content.