When we convert direct speech into reported speech, we need to make a number of changes in addition to removing the inverted commas.
"I hate peas!" screamed Lily.
Lily screamed that she hated peas.
The word I changes to she because we are reporting what somebody else says.
The verb hate (present tense) changes to hated (past tense).
The exclamation mark is left out.
"When is Dad coming home?" asked Zach.
Zach asked when Dad was coming home.
In this example, the verb is (present tense) changes to was (past tense), and the question mark is left out.
Because it is a question, we have to change the word order as well. The verb (was) no longer comes straight after the question word (when) but is moved further along the sentence.
(Zach asked when was Dad coming home is incorrect.)
Reported speech is sometimes called indirect speech.