Although, there are a few causes the most common is the PCV Vent Tube which is located in the middle of the intake near the firewall (behind the throttle body) & runs from the intake to the passenger side intake manifold.
If you navigate over to the "how to section" there's a writeup on this issue.
There's also a few YouTube videos out there...
This one is very detailed and is instructions on changing your intake gaskets... I just like his instructions and this is not necessarily your issue. It'll help you understand what to remove to gain access to the rear of the intake and what tools you'll need.
Ford 5.4L 2v Engine Intake Gaskets P0171 P0174:
http://youtu.be/IJJTlDrCaUQ
This one is the actual pcv tube replacement...
F150 PCV Tube Replacement:
http://youtu.be/7UL6yST1aUY
On my truck (2000 5.4 Expy) the vent tube was the last thing I checked because I was getting other codes along with the p0171 & p0174.
The other codes were...
p0357 p0308 p0161 and p1506
I changed plugs, coils, o2 sensor, and fuel filter before I checked the pcv tube.
Once I cleared out the other codes and changed the pcv tube my truck has been running like a champ.
If you get into the pcv tube replacement or repair I would clean out the throttle body, iac valve (behind the throttle body), and your intake. All of that stuff tends to get caked up pretty good.
Hope this helps.
Here's what mine looked like once I got it out...
Sent from my SAMSUNG-SGH-I337 using Tapatalk