Same problem here. I am about a grand deep on this one now. Here are the parts that could be an issue if it works with the hubs in manual but not in automatic.
- Dash Switch - haven't changed mine seems OK
- PCM? One part of the computer sends the signals to the ESOF solenoid and the transfer case relays. Mechanic tested seems OK on mine
- Transfer case relays - my transfer case is 100% OK, may be your problem though. Cheap easy fix
- ESOF solenoid - I am on my 4th one. Original was bad, dorman one was bad, ford one failed in 2 months, on another ford one. Now the mechanic indicated this was the issue last time and so I got a replacement for free from ford. Unfortunately after a week, 4wd failed again. I don't think this is the issue.
- Vacuum System. You need to have a functional vacuum pump, integral lines, and vacuum tank. If you have a failed vacuum system your heater will not leave defrost or will switch to defrost when you select 4x4. I had bad vacuum pump and failed ESOF and bad ESOF which caused vacuum leaks.
- Vacuum lines from ESOF to hubs. I have replaced the sections from the axle to the frame with silicone ones as mine were falling apart. Did not resolve the problem
- Hubs - Both of mine failed and were replaced. Mechanic indicates mine pass vacuum hold test but I am suspicious they did not rebuild everything correctly here. i will repeat the vacuum test myself once the temperature is back above 10. i need a bigger garage, this monster doesn't fit in mine!
With a mitivac you can troubleshoot a lot of this system by just hooking it in line with the vacuum lines and watching what the system does. There are a lot of articles on here about that.
Good luck, please post what you find on here it may help me and others.