Welcome to TRS
It needs to match 2WD or 4x4 which ever you have, they are different
And you are in luck, 1998-2000 Rangers have more options, basically you can use any 1998-2011 4.0l 5R55E transmission, from a Ranger or Mazda B4000
In 2001 Rangers got new computer software that requires an ISS sensor that was added to the 2001 -2011 5R55Es, also an extra bolt hole
The 1998-2000 computers don't use it so doesn't matter if ISS there or not, and still uses the same bolt pattern so extra hole isn't an issue
All the wiring and plug-ins are the same
Keep track of the year of the trans you do use, put a sticker in engine bay, internal parts might be a bit different, just for future service