Hey there, thanks for the question.
more commonly on these trucks where the 4wd light comes on when driving its because of the sensors on the transfer case. Now while it's possible that one single sensor could be bad, I have seen an issue where water gets past the dust cover on the prop shaft and enters the transfer case. It damages all three sensors in some circumstances. Nissan made a revision to the dust cover and replaces all 3 sensors and the cover for about $500. The transfer case is also drained and fresh fluid put in.
Now you could do the repairs yourself for close to $250 for all parts.
Best place to start would be to see if its a single sensor or multiple faults before proceeding.
Let me know how else I can help. thanks.