First thing is to check out the shift linkage to see if the positions are correct.
Put it in 2wd and look at the hardware, then in 4H and look again then 4L look again.
The positions send the signals to the PCM on what to do and engage the tranfer case and front actuator.
The actuator that shifts the transfer case internal power flow to 4L also signals the computer via a dedicated line to change program control..
Unless you go over all this, it can't be guessed at unless your lucky..
Good luck.