Cobaltates have rich spin-states and diverse properties. Using spin-state pictures and firstprinciples calculations, here we study the electronic structure and magnetism of the mixed-valent double perovskite YBaCo2O6. We find that YBaCo2O6 is in the formal intermediate-spin (IS) Co3+/low-spin (LS) Co4+ ground state. The hopping of eg electron from IS-Co3+ to LS-Co4+ via double exchange gives rise to a ferromagnetic half-metallicity, which well accounts for the recent experiments. The reduction of both magnetization and Curie temperature by oxygen vacancies is discussed, aided with Monte Carlo simulations. We also explore several other possible spin-states and their interesting electronic/magnetic properties. Moreover, we predict that a volume expansion more than 3% would tune YBaCo2O6 into the high-spin (HS) Co3+/LS Co4+ ferromagnetic state and simultaneously drive a metal-insulator transition. Therefore, spin-states are a useful parameter for tuning the material properties of cobaltates.