To be a good conductor the current should flow easily. Flow of electron is current. If electrons are available more then they easily moves from the valence band to conduction band and they act as good conductor. Al has 1s22s22p63s23p1 electron and it loses its valence electron quickly. Whereas Mg has 1s22s22p63s2 which is a stable configuration and so it wont lose its electron quickly. That is why the Al acts as good conductor than Magnesium