He has lost nearly his all many pets.
I take it he did not lose pets that he had almost acquired... such pets would be "nearly his". In this sentence "nearly" modifies "all" so it need to be right before it as "nearly all"
You may say "he has lost nearly all his many pets" but do not say "he has lost his nearly all many pets"-- but as for a rule to tell you why, this is more complicated.
Perhaps you can tell that "nearly all many pets" is wrong. It wants to be either "nearly all of the many pets" (or in this case "nearly all of his many pets") The "of" needed (or implied) because you are saying two different things about the pets. (1) He has many pets and (2) he lost nearly all of them. It is as if the "nearly all" modifies how he lost them, but "many" is about all his pets; "many" tells you something about even the pets that were not lost.
I think this is better with the "of"-- but once you have them in the correct order, it can be written with or without the "of". Hence: He has lost nearly all (of) his many pets.