Texas family code holds the maintenance of best interests of the child to be the primary goal of all decisions made by the court. They will consider all factors placed before them and attempt make a decision that places the child in the most stable, secure and nurturing environment available to them.
The court will take the child's age into account and any mental or physical infirmities that he or she may possess. It will also carefully weigh any reports that the child may have been harmed or abused in any physical or emotional way. The court must take any allegations or history of substance abuse in the household into consideration.
Any parent or guardian that wishes to assume greater custodial duties over a child must be able to demonstrate that they can properly clothe, feed, nurture and educate their charge. A safe and protected home environment should be maintained, and the child should be sheltered from the effects of violence and abuse even when the abuse is not directed at them specifically. Finally, if the child is old enough to make a responsible decision about their own best interests, then the child's wishes may be taken into account.
Child custody decisions are rarely made in a vacuum. The number of different factors and competing interests can make it difficult for the people involved to understand the situation, and the court may have a difficult time making sense of the confusing and conflicting information that they are presented. It may be advantageous to consult with a family law attorney about the best way to demonstrate to the court what the best interests of the child may be and what course of action may best serve them.
Source: FindLaw, "TEX FA. CODE ANN. § 263.307 : Texas Statutes - Section 263.307: FACTORS IN DETERMINING BEST INTEREST OF CHILD ", November 10, 2014