The Texas Family Code can be found online at http://www.statutes.legis.state.tx.us/. Child custody is covered in Title 5 (Chapters 101-266). Although your question is rather broad, I suspect that you might be most interested in Chapters 153 and 154. I recommend, however, that you talk with an attorney about your specific situation, because facts make a big difference in child custody matters.
The on-line version contains only the current law.
There is also the printed version.
BUT there are "expanded" versions that also include comments and important cases. One publisher is West. Law schools sell these and they are also available for sale on-line. They cost over $100 but every family law attorney owns at least one of these books.
You can get it online or you can get a printed version; however, if you are handling a family law matter, you should contact a family law firm that, not only has the code, but knows how to use it. Good luck and God bless.