There are three ways to find the code. One is a lot easier than the other and much less work if you have a good eye and great flashlight. There are some Excursions, F250 and F350s that have a different wiring system.
The first location to look is just above the right front kick panel; the RAP module is black in color with the numbers on the front (the same as the white module). If you look above the kick panel you can see it quite clearly without taking anything apart. If it is not at this location please follow the next step.
This part is not hard to do. You will need to remove the front cover under the steering wheel that says fuse box. (It has 4 plastic screws to remove) under the dash, the five (5) digit code is on the cream/white box behind the radio, look to the top right of the open fuse box cover through the wires. (towards the fire wall). At the back firewall, look for a 5 digit code on a sticker on a cream/white box. This is not easy but if you try every angle I promise it will appear don't forget to use a very powerful flashlight if you want to see it.
Note: The RAP module sometimes is covered by insulation making it almost impossible to see.
It is located on the firewall behind the radio just below the windshield.
The third way is a more time consuming job because you have to remover the stereo.
Once you do, look to the rear you'll be able to see the 5 digit code very easy. This process can take 2-10 minutes.
You will have to release the compartment on the right side of the steering wheel in your dash. Then there will be some insulation that you will have to push to the side. There will be a little black box on the firewall with a 5 digit number. I believe the number is printed on a white label. This is the factory code. Once you have that, you can enter it in then press the 1-2 and 3-4 buttons at the same time then enter in your own code. The truck will lock then unlock if you've done it right. Oh yeah - you have to do each step within 5 seconds of each other for it to work.
I used the info I found here on FTE - I found the easiest way was with a dental mirror and a flash light. I looked up in an area under the dash just behind the radio (it's about a foot up there). I found the numbers impossible to read without the mirror - no matter how much I dug around, my head just would not get in the right position. Ford will want about $100 to get this for you (unless they really like you).