Anomalous metal-insulator transition observed in filled skutterudite CeOs$_4$Sb$_{12}$ is investigated by constructing the effective tight-binding model with the Coulomb repulsion between f electrons. By using the mean field approximation, magnetic susceptibilities are calculated and the phase diagram is obtained. When the band structure has a semimetallic character with small electron and hole pockets at $Gamma$ and H points, a spin density wave transition with the ordering vector $mathbf{Q}=(1,0,0)$ occurs due to the nesting property of the Fermi surfaces. Magnetic field enhances this phase in accord with the experiments.