generally speaking, this comes down to a matter of simple trial and error. you need to find your sweet spot of calories with the proper macronutrient blend that works to help you realize your goals. if you're looking to cut up, i might consider focusing on more of a 50/35/15 type split. which means, say you take in 3500 cals a day. 50% of those calories will be derived from daily protein intake, 35% from carbs and the other 15 from healthy dietary fats like omega 3s, fish oils, poly/monounsaturated fats, etc.
you need to rev your metabolism by eating smaller meals more frequently, evenly spaced throughout the day. i tend to eat every 3 hours, roughly 8 times a day on training days, 6-7 on nontraining days. every meal should be high in protein to encourage muscle gains and maintain your size, while carbs and fats kept to a respectable serving to encourage constant lypolysis during the day and not fuel your adipose (fat) tissue.
so, for your particular goals -- i.e. wanting to "build" muscle while leaning out simultaneously -- control your appetite by eating healthy, lean meals that stick to these macronutrient portions. utilize healthy protein sources for each meal coming from foods such as chicken breast, tuna, low-sodium turkey breast, turkey burgers, nuts, eggs, etc. carbs should come from low GI sources, like brown rice, whole wheat breads/ pasta, non-sugary fruits, lots of veggies, etc.
experiment with different meals and find your sweet spot of cals that lets you cut fat.
also, if you want to cut, DON'T BE CONCERNED WITH BULKING. you can't have your cake and eat it too necessarily.. while it'd be great to build solid mass and cut up, you can't kill two birds wiht one stone when it comes to bodybuilding. so focus on leaning out first... eat less crap and more protein and don't focus on strength training. do more high volume type lifts and eat right, maybe adding some non stressful cardio post workout like a brisk walk on the treadmill.
you will reach your goals. good luck bro hope this helps