2004-1/2 and 2005 will work, don't let salvage yards tell you any different.
Also, when the apps show the 2006-2007 as different between 2wd or 4wd, it's because the driver's side cast iron engine mount bracket is different between the 2.
Same deal with manual or auto, they are taking into account for the trans cooler and lines.
In short they list it as an ASSEMBLY from a specific application, which is essentially a pull out from flywheel to fan hub.
Strip them all down to a basic short block and except for the pistons in 2003-early 2004 and the timing cases for all of '03 and '04, they are all compatible with each other.
I could list all the subtle differences, for
CR 5.9s, but it'd be a couple of hours and this job doesn't pay that well.
Mark.