From scratch do you mean making your own motherboard and other electronic components?
I assume you mean assembling the standard computer components to make your own custom machine as opposed to buying a "server."
Essentially any computer can be a server. It just depends on what you intend to use it for. If you already know what services the server will provide then look into what the hardware requirements are for the software you intend to use. Primary hardware considerations for machines designated as servers involve reliability of the components, typically include a RAID array for Hard drive performance/reliabiliity, more RAM than the average machine, and a fast good quality network card or cards.
As to software the concerns include performance, reliability, security, and of course cost can be a factor.
I recommend Linux personally and there are several linux distributions which are packaged specifically for setting up as servers, though most can be configured as such regardless.
With windows you would be looking at a server version of the operating system at a higher cost which depends on the varying licensing required based on how it will be used.
Personally, I have found windows servers to require more maintenance and configuration (particularly in keeping secure), much harder to get optimal performance from the hardware available to it (especially since you are stuck with running the GUI), and tend to be less reliable or suffer from shorter consecutive uptimes, YMMV.
A google search for "build your own server" will give you several links with more step by step type info.