Everyone's metabolism is different. For me maintenance is around at least 3000 cals/day. I could eat that little and probably not lose weight. For me to gain quality mass, I need to consume at least 2-3 grams of protein per pound of bodyweight a day, along with quite a bit of good fats. I can eat a ton of (good) carbs while doing this and not get fat. If I consume even a moderate amount of dairy I will store fat around my abdomen and lower back though.
I know people who have to really watch their carbs or they'll get fat. Not me. I can eat bread and pasta all day and stay lean.
There are some general rules you can follow, but everyone really is different.