Legislation that is written on child custody is always aiming to protect and benefit the child in all circumstances. The courts always want the children in question to have as much contact as possible with their biological parents. The only reason that they would prevent this from happening is if they believe that one or both of the biological parents could present a danger to the child or affect them negatively.
Although criminal convictions will never look good as part of your child custody proceeding, the court will view the situation very subjectively. The way that the court views your criminal record will depend largely on the nature of the crime.
They will take into account who the victim of the offense was, if any, and what the nature of the crime was. If the crime was violent in nature, the court may interpret this as a sign that you pose a danger to the child. Furthermore, if the past crime was in relation to your child or any other child, the court may impose strict limitations to visitation rights, such as supervised visitation hours.
Drug crimes are often a common issue when attempting to gain custody of a child. Although drug crimes are not violent in themselves, and if the crime was drug use rather than selling, there is no victim involved. However, the court might see a drug conviction as a sign that you might not be fit to take adequate care of your child.
A criminal conviction, especially an isolated one, should never be a reason to lose hope over gaining custody of your child. The courts take all aspects of a case into account and will never blindly dismiss a case before looking into all of the details.
Source: Findlaw, "Criminal convictions and child custody," accessed Oct. 09, 2017