When I used to run track my coach would tell us to eat a bunch of spaghetti the day before a big race because it would give us energy. Recently I ready a study that said whenever you eat complex carbohydrates your body automatically stores it as fat because it cant break it down. I am trying to minimize my body fat whilst gaining muscle mass. This requires many carbs with are easy to get form starches. So should I avoid these foods or not?
The body does not store complex carbs directly as fat, usually. The study you read might have been referring to a condition called insulin resistance. For carbs to be stored as energy it requires the release of the hormone called insulin. Insulin will direct blood glucose into your cells to eventually be stored as glycogen, however if you fuel up on too many carbs for too long, your cells will begin to reject insulin and the glucose it has to offer because they are essentially "full" and don't want anymore glucose. This is called insulin resistance. Carbs converted to blood glucose that are not stored as glycogen end up being stored as fat, and maybe that's what you read in the study. Otherwise, carbs and fats metabolize very differently.
As for how it relates to building muscle, understand that losing fat and gaining muscle require essentially the opposite types of nutritional strategies, if you really want to make progress in either endeavor. To build muscle, your focus is on supplying your body more than adequate calories to provide the best environment for growth. To lose fat, the focus switches to a decrease in calories, and a higher amount of protein to spare any potential muscle loss resulting from the calorie deficit. You said you want to minimize fat while you gain, and while that's certainly possible, if building muscle is your main priority, make sure most of the things you do are aimed towards that. That said, it can be extremely exhausting (both physically and mentally) to put yourself through challenging workouts day in and out without a decent amount of carbs. Unless you have a reason not to eat them, including them in your diet will certainly aid performance in the gym. As it relates to starches, starchy carbs typically carry a high glycemic index, meaning they raise blood sugar quickly, which increases insulin resistance. Try to include a higher % of lower glycemic foods, which can be found from the link below.