There are two types of custody, which are physical custody and legal custody.  Physical custody means the parent with whom the child lives.  Legal custody means making decisions about the child's education, health care, etc.You have strong legal arguments for sole physical custody since you have a stable home environment for your child, while the mother is homeless.  As for legal custody, it is possible that both parents could have joint legal custody for making decisions about the child's education, health care, etc.