There are a number of ways that you could say this, including:
Phonetics, when it is taught by Ms. Rose, is my favourite subject.
Phonetics is my favourite subject, but only if it is being taught by Ms. Rose.
If Mrs Rose is teaching it, then Phonetics is my favourite subject.
You can use your sentence but you need to change it to:
Phonetics which is taught by Ms. Rose, is my favourite subject.
Note the comma in the middle of the sentence. This makes 'Phonetice which is taught by Ms. Rose' the subject of the sentence. However, no matter how you say this it may sound to the hearer as if you had said:
Phonetics, which is taught by Ms. Rose, is my favourite subject.
Note the second new comma. This effectively means that Phonetics is your favourite subject, and Ms. Rose just happens to be the teacher. This is not what you want to communicate. As a consequence it is best not to use this sentence at all.
You cannot say:
Phonetics by Ms. Rose is my favourite subject.
'By' does not imply or connote 'teach'.