It's nearly impossible to lose fat and gain muscle at the same time. In order to lose fat, you need to eat a calorie deficit. In other words, you need to eat less than you burn during the day. In order to gain muscle mass, you need to eat more calories than you burn, because it takes calorie energy to add muscle.
Now, if you are just starting out with weight lifting, you might see a slight increase in muscle mass. Some people do when they first start. But that won't continue if you are eating a calorie deficit to lose fat.
There are a lot of good stickie threads about this, you should check them out. I'm not an expert by any streatch of the imagination.