Following rules are applied to change pronouns in direct and indirect.
In above mentioned examples first persons (I/we) of reported speech are replaced with subject (He) of reporting speech. That is why we replace I with he and we with they in reported speech respectively.
Note:- Some people may be bothering about they in sentence no 2. Why we is replaced with they instead of he as I is replaced with he in sentence no 1. The reason is we always change first person with subject of reporting speech but in doing so we must keep in mind case (subjective, possessive, objective) and number (singular, plural) of pronoun being replaced. In under discussion example, the pronoun being replaced is we which is subjective in case and plural in number so we have to make he subjective in case and plural in number before placing it in the place of we. After making he subjective and plural he will become they and then we place it in the place of we.
In above stated example second person (You) of reported speech is replaced with object (me) of reporting speech. That is why we replace you with I in reported speech.
Note:- Some people may be bothering about I in above mentioned sentence. Why you is replaced with I instead of me. Again the reason is we always change second person with object of reporting speech but in doing so we must keep in mind case (subjective, possessive, objective) and number (singular, plural) of pronoun being replaced. In above given sentence, the pronoun being replaced is you which is subjective in case and singular in number so we have to make me subjective in case and singular in number before placing it in the place of you. After changing me in subjective case and singular number me will become I and then we place it in the place of you.
In above stated example third person (He) of reported speech does not change. All third person pronouns (he,she,it,they,singular names,plural names) do not change either with subject or with object of reporting speech.
Most often more than one pronouns occur in reported speech. In that case all pronouns of reported speech will be changed or replaced according to aforesaid three rules. In other words all first persons will be changed with subject, second persons with object of reporting speech and third persons will not change.
In above stated first example there are two pronouns (you) and (my) in reported speech. You is second person and my is first person. so we shall replace you with object of reporting speech which is me and my with subject of reporting speech which is he. After applying case and number restrictions you will become I and my will become his in reported speech.
In second example there are two pronouns (I) and (my) in reported speech. I is first person and my is also first person. so we shall replace both I and my with subject of reporting speech which is he. After applying case and number restrictions I will become he and my will become his in reported speech.
We always change second person with object of reporting speech but if there is no object then we shall suppose first or third person as an object of reporting speech.
Here in this example (you) is pronoun in reported speech so we shall change it with object of reporting speech but there is no object. So we have supposed first person (me) as an object of reporting speech and then changed you with supposed first person.
Note:- We shall always change 'say' into 'tell' only when there is an object in reporting speech but if there is no object in reporting speech change of 'say' into 'tell' is optional.
Note:-SAY can’t be followed by an indirect object without the preposition TO. TELL is followed by an indirect object.