Yes, i am aware this is a duplicate of this, but it was never directly answered and instead given an off topic answer, but in my case, the host computer cannot format the partition using the installation setup, i am trying to install Windows XP and Windows Server 2003 on the same computer, so is there any way i can pull the hard drive out, plug it to my laptop(Windows 10) using some intermediate cable, partition and format it, then install the OS's on it, then put it back again.
We do it all the time in our laptop shop, get a pc, remove all other drives, then install windows on it, like you should and wait for the moment it first time says rebooting in 10. Now is the tricky part: when it shuts off, you need to press the power button, so it shuts off, put the HDD or SSD to the disk owner pc and next time it boots off it, it will get the windows setup screen, asking about what and how to set the settings (partitions you can select before installing windows, in the windows recovery environment, when you boot off the usb)
I don't have enough reputation to comment, so I'll have to ask it here: Can you clarify your question?
Is it "I can't format a specific partition" or "Can you tell me how to install Windows on an external drive connected through USB"?
If you can't format it during the Windows installation, yes, you can just plug the drive on another computer and format the partition from there. I'm guessing that since you'll put that drive back on an old machine you won't be using UEFI to boot, thus you'll need to make sure it's being formatted as MBR, not GPT.
Another way to format that disk would be to create a bootable linux pendrive and use format you disk from there. I advise to try the Windows route first though, since you probably have no Linux experience.
After formatting return the HD to its own system and proceed as a regular installation, using a CD drive, USB stick or whatever means you're using to load the Windows installer. Just skip the offer to format the drive (again) when the time comes.
Now, if you want to install Windows on an external HDD—and I really mean external here, those drives which have an enclosure and are plugged through USB, not a regular HD temporarily coming from another system—so you'll have a portable Windows, then you can use WinToUSB. I'll write a quick guide pointing you in the right direction if that's the case.
You can also use it to install Windows on a regular HD coming from another system, but that'll require more work than just installing the OS the normal way after you format the disk, and it might not work for Windows XP/Server 2003 installations, so let me know if you wish to try this route.