Dynamical screening and magnetic phases for electrons in solids