My friend got Windows 7 and he asked me to install windows xp, but since his optical drive doesn't work I made a bootable usb using win to flash and when I boot the setup starts but when it comes to where I want it installed it's like it doesn't detect any partitions, it just says detected partition W with total space of 3.7 gigs like my flash. It is like it wants to install XP on itself. How can I fix that?
Most likely, you can't, because the drivers needed to do this simply do not exist.
You will need a driver for the Windows first stage installer for your specific motherboard because Windows XP came out before SATA even existed, and after that you will need XP drivers for the rest of the hardware in your computer. There is a very strong possibility some or all of these drivers simply do not exist.