The main difference between the two is parentage. When a child is in custody, this means that the parent is responsible for the welfare of the child. The parent will make sure that the child is adequately cared for. A guardianship can be awarded to someone who is not necessarily the parent of a child but will still be in charge of caring for the child.
There are instances when someone will act as a legal guardian while the child is in the custody of one of the parents. For example, child custody has been awarded to the mother of the child, but the mother has to work overseas so that the legal guardian would be the aunt of the child. The aunt will be in charge of caring for the child while the mother is away.