1.) Uses the manually configured router id stored in the start up config.
2.) If the router id is unset statically from a command it uses the numerically largest loopback interface assigned an IP address.
3.) If the Router ID and the loopbacks are not set \ have IPs then it will use the largest nonloopback IP address.
If no IP addresses are set for loopbacks and nonloopbacks as well as no router ID command set OSPF processes will no start.