The 4WD will not work if there is a problem with any of the four ABS sensors. Check for broken or loose wires on each of the sensors. A shop can can use a scanner to determine which sensor is faulty if there is no visible problem.
2006 X-Trail LE 5 speed, 1997 Subaru SVX, 2011 BMW 535i GT, 2012 Moto Guzzi Norge GT 8V
I would think a problem with the transfer case or rear differential would also cause the AWD to not function. It may be crazy, but if the car is new to you, and the previous owner had just changed the stereo there is a possibility they did not reconnect the AWD selection knob electrical connector when putting the front stack fascia back in place. You could check to see, but otherwise, have your mechanic check the transfer case.