A characterization of countable Butler groups