As Chris said, the order is not determined by which person ( I/You/He ) but by the meaning in the sentence. So, for example you could have
I gave it to him / I gave him it. or
He gave it to me / He gave me it.
So . . . the subject of the sentence is first (It gets more complicated in the passive voice, but let's skip that for now).
Then follows either the direct or indirect object depending on which form you are using. To be precise, direct object followed by indirect object prepositional phrase (to me, to him). Or indirect object if it is just the word, not a phrase.
I'm sorry... it is quite complicated. Repetition of the type of sentence may help it become more natural to your ear.