Passive form of "John is painting his room"
When we want to change a statement from active to passive, in the present continuous, we have to change the verb that is continuous from the active verb to the continuous for of be and the past participle of the active verb.
E.g. if we start with is painting then we have to change it to is being painted by.
However I'm not sure how to change the subject and the object. If we start with:
John is painting his room.
Is the passive construction:
His room is being painted by John.
Something seems wrong when comparing the two sentences, but I'm not sure what. Does his in the passive construction refer to the same person as in the active?
Solution 1:
There is nothing grammatically incorrect about
His room is being painted by John.
However it doesn't carry the exact same meaning as
John is painting his room.
The first (passive) means that John is painting someone else's room, where as the second (active) could mean that, but it's more likely that it means that John is painting his own room.
You clearly know how to form the passive, but the change that needs to take place is that you need to make sure the same person is doing the same thing to the same object as in the active.
If we assume the room in "John is painting his room" to be John's room, which is most likely without further context, then to turn it to a passive construction you need to start by specifying whose room it is: John's room.
Next you make the action of painting passive, which you did correctly: is being painted.
Finally you specify who is doing the painting: by him.
John's room is being painted by him.
The last part (by him) can cause the inverse ambiguity of the original (active) sentence, i.e. we assume the him refers to John but it could refer to someone else. To completely remove the ambiguity you could change the last bit:
John's room is being painted by John, himself.
But usually the given context removes ambiguity.
Solution 2:
The agency ("by John") is not absolutely required when using the passive. In fact, this is why so many people object to it. So a passive version of your sentence could be as short as
John's room is being painted.
This is why English has several ways to say the same thing. While they may appear to mean the same, they have different emphasis and the choice of wording can be important. If you are explaining why John is sleeping in the living room tonight, John's room is being painted sounds better and makes more sense than John is painting his room. But if you are explaining what John is doing today, it's the other way around.
If the "by John" or "by him" part is actually important, the simplest thing to do in your rather mechanical rule is to add a step where you check for any pronouns (like him or his) and adjust the order to make the sentence clear. So His room is being painted by John becomes John's room is being painted by him. But this isn't a sentence a native speaker is likely to use. Where I might see that kind of construction is where the painter is not the room owner: this room is being painted by students as the equivalent of students are painting this room. You would choose the passive version if the room was more important (showing someone around your house) and the active if students were (a teacher explaining activities, perhaps.)
The real point is that a rule for how to transform active into passive will not produce natural sounding sentences. It's unfortunate that instructors sometimes assign the task of doing that. You have a better chance of getting a good sentence if you leave of the "by whoever" part of the passive sentence, though if you are doing this for an assignment your instructor might lower your mark for leaving off some of the content of the original sentence.