How can I build custom bitcoin network and start with bitcoin codebase
Try reading the book Mastering Bitcoins by O'Reilly Chimera, this should help in understanding the bitcoin network, process and the principles involved.   

Here is a guide (from bitcointalk.org) on how to make a new altcoin by cloning the bitcoin code.

I would suggest understanding the process before trying to make your own custom network