There is one imperative rule that goes along with this statement. You have to be involved in some sort of resistance exercise, such as lifting weights. Now, to be clear, you do not have to weight training at the exact same time you are fasting, but resistance training must be occurring at some point for your muscle mass to be preserved in the face of a caloric deficit.

