Why does the NIV use ’you’ where the NKJV uses ’he’?
It is simply based on their translation philosophy - the NIV tends and intents to be less formal (literal) and more dynamically equivalent to (translators' perceived meaning of) the Greek. So in translating the Greek and trying to understand the English they used will not be helpful. Interpreting the passage and trying to understand why they translated it in this way will explain why they went with their choices.
Let's start with translating the subject of the sentence:
τις
- Part of Speech: indefinite pronoun
- Case: Nominative (subject; predicate nominative)
- Number: Singular
- Gender: Masculine
It should be translated as "any man" (KJV) (indefinite singular masculine). NKJV uses anyone (indefinite singular neuter) and NIV as "you" (second person (singular or plural)). It tells you how they interpret the sentence by applying it directly to the reader and speaking to him/her personally.
This clause is in the potential subjunctive (if any man sees..) part of the sentence, which means a subordinate clause will follow. In this case, it is an active indicitive (αιτησει), and so to be consistent with the subject chosen:
- you should pray (NIV)
- he will ask (NKJV)
- he shall ask (KJV)
This phrase is the translation of a single word in the Greek: αιτησει. The form is sufficient to translate it into English as a whole phrase since English does not carry its meaning primarily in the form of the word like Greek does. If we look at the form of the verb (ask) we see why the formal translations go with the above phrase:
αιτησει
Tense: Future
Voice: Active
Mood: Indicative
Person: third [he/she/it]
Number: Singular
So this word must be directly translated as "he, she or it shall/will ask", and the pronoun simply depends on who the subject is that will be asking. Who is the subject? This is a matter of interpretation of the sentence not translation.
If any man see his brother sin a sin which is not unto death, he shall ask...
In this case it is very clear that it is the subject of the sentence. This verb itself does not have gender, so for NKJV translating the subject of the sentence as "anyone" is not helpful to understand the "he" they choose later. Could he not refer to the subject of the passage? When it is "any man" as the subject of the sentence it is clear, and the use of "he" as the active participant of this subordinate clause makes clear sense.
For the NIV then to have made you the subject, it must now keep you as the subordinate participant.
It must be for gender neutrality that both NIV and NKJV went with the gender-neutral English for the subject of the sentence.
Why/how is this taken/assumed to be referring to be ‘God’?
As for the conclusion of the statement (and God/he/He will give), why did the NIV go for God, since the Greek does not have the word for God?
It is simply for clarity because it again depends on interpretation as to who the active participant of the subordinate clause is referring to as the subject: the subject of the sentence or the subject of the passage.
So, as not to assume by the reader that it is the person asking that gives life, some translations inserts God not based on their translation philosophy but for clarity. The NASB, a very formal equivalent translation does the same, but they italicize words added for clarity. And God is italicized in this translation:

Why/how is this taken/assumed to be referring to be ‘God’?
Again, a singular Greek word is translated as the English phrase "he shall give" because of its form:
δωσει
- Part of Speech: Verb
- Tense: Future
- Voice: Active
- Mood: Indicative
- Person: third [he/she/it]
- Number: Singular
It is exactly the same form as the previous verb, which means the formal equivalent translation is "he/she/it shall/will give". So again it is a matter of interpretation (not translation) to know who the subject of this subordinate clause is. Who is will/shall give life?
The answer is obvious from the preceding verses:
And this is the record, that God hath given to us eternal life, and this life is in his Son. He that hath the Son hath life; and he that hath not the Son of God hath not life. These things have I written unto you that believe on the name of the Son of God; that ye may know that ye have eternal life, and that ye may believe on the name of the Son of God. And this is the confidence that we have in him, that, if we ask any thing according to his will, he heareth us: And if we know that he hear us, whatsoever we ask, we know that we have the petitions that we desired of him.
(1Jn 5:11-15)
Notice that God is the subject of the discussion and the giver of life. Any dependent singular pronoun not immediately associated with the subject of the sentence is referring to the Subject of the discussion.
Hence by interpretation the subject of the verb (δωσει) is referring to God, the Subject under discussion Who gives life to (and through) them that ask. Since the danger exists that one might use verse 16 out of its context and imply that it is the asking man giving life, it makes sense why NIV and NASB add the word God not in the Greek.