YOU SAID:
the white dog went to the red school hall when he got in trouble.
INTO JAPANESE
白い犬は困ったとき、赤い学校のホールに行きました。
BACK INTO ENGLISH
The white dog went to the red school hall when it was in trouble.
INTO JAPANESE
その白い犬は困ったときに赤い学校のホールに行きました。
BACK INTO ENGLISH
The white dog went to the red school hall when it was in trouble.
That didn't even make that much sense in English.