Man. Age: 28 Height: 174 cm (5' 8 ½") Weight: 50 kg (110 lb) Waist: 71 cm (28")
I really want to get fatter fast and also fit.
EDIT: Since "fit" is a very arbitrary term, I should include my definition, since the asker did not.
From the starting point of a 50kg man, I consider fit to include
As you can see, I actually include knowledge about basic anatomy and human biology to be part of fitness. I know a lot of people consider a 6-pack to be the brilliant display of fitness, but it's not. From a purely scientific perspective, having a 6-pack is nothing compared to having the knowledge and discipline to actually keep your body ready for disaster, be it disease or accident, or any other emergency.
Being fit should entail being able to haul ass out of a disaster area at a moment's notice, and being able to help someone in distress.
Keep in mind, this is my definition of being fit. And spoiler alert; it takes time.
Clearing up some confusion
First of all, this question can't be answered with a fixed amount of time. You're probably hoping for us to say "3 months", or possibly lower, but that would be entirely false.
Here's the honest truth: It's going to take you at least two whole years of training multiple times per week, being very picky about what you eat, and going to bed early. Then after that, if you want to stay fit, or get fitter, you have to keep doing it.
You're asking about how to get fit fast, but that's not how it works. If it was fast, everyone would be fit.
Been there. I was 186cm and 60kgs. Very, very skinny. It took me three years to gain the weight I wanted, and then I had to increase my efforts to shape my body into something I thought looked good.
You're going to have to eat even when you're full. You're going to have to train even though you're tired and unmotivated.
So what do you do?
You get a program that includes not only a workout plan, but a meal plan. And make sure it's a program that takes into account your current measurements, and your current goals.
I hate to say it, but it sucks to hear people looking for "fast" ways of getting in shape. People who expect fast results don't know how the body works. After three months, they get demotivated because they expected to be ripped already. They think something's wrong with them, and they quit.
If you want to be fit, you have to completely change your lifestyle. Permanently.
Probably about 2 years. That said, enjoy the journey.
A few extra thoughts:
Firstly, I'm going to ignore the 6-pack part of your question, since that is contradicted by the body of your question, stating you "want to get fatter fast and also fit". A 6-pack occurs when one's body fat percentage is extremely low. Everyone has a rectus abdominis muscle, it's just not externally visible on those with body fat levels that are typical even for a fit person.
Secondly, a disclaimer: I'm going to define target weights in terms of Body Mass Index (BMI), because I think it's useful for estimating what a person's bodyweight would be at different builds. Many like to criticise the BMI because it can incorrectly label muscular people as obese, but that shouldn't be relevant here as I'm not using it as a tool for assessing risk of obesity-related medical conditions.
Thirdly, my background, which is relevant because I have been a skinny person who has deliberately gained weight. In my early 20s, I was about 66-67kg at 185cm height, which is a BMI of 19-19.5. Sporadic weight training took me up to a much healthier 75-77kg (I'm not sure over what time period, but maybe a year), and more serious weight training combined with tracking my food intake took me from a healthy 77kg to a much stronger 85kg in 4 months. I'm currently at 88kg and can barbell squat over 150kg, and deadlift over 200kg.
Now, let's define some measurable goals. At 50kg and 174cm, your BMI is 16.5, which is dangerously underweight. We are talking about similar risks of death to an obese person, though from different causes. Let's arbitrarily aim for a minimum BMI of 20 to avoid the health risks associated with being underweight, or a BMI of 25 if you want to get strong.
On a decent strength training program, with sufficient food intake, you could easily gain 0.5kg per week and have the vast majority of that be muscle. So to get to a healthier BMI of 20, you would need to get to 60.5kg, which means gaining 10.5kg, which would take you a bit under 5 months. To get up to a BMI of 25, you'd need to get up to 76kg, which means gaining 26kg, which would take you a year at that rate.
So that answers your explicit question of "how long?", let's move on to the implicit question of "how?", which means elaborating on what I previously described as "a decent strength training program, with sufficient food intake". Your strength training program should be a defined program (as opposed to just randomly applying a bunch of different exercises), most likely involving sets of 5 reps of the following basic barbell lifts: back squat, deadlift, bench press, overhead press. (Intensity of strength exercises is often measured in number of reps, with the implication being that the weight is chosen to be heavy enough that you couldn't complete a higher number of reps. So working at 10 reps means a lower amount of weight and training endurance more than strength, whereas a 1 rep weight is such a high intensity that you can only lift it once before you're too fatigued to continue. 5 rep programs are generally considered to be a good balance between strength, endurance and hypertrophy training.)
Sufficient food intake means eating enough that you are continuously gaining weight, and continuously getting stronger. The former of these can be measured using a scale, and the latter can be measured by your progress in the gym, with the expectation that you are able to add weight to every one of your exercises every time you perform it. If you stop gaining weight or fail to add weight to your exercises, then you need to increase your food consumption. But in order to be able to reliably increase your food consumption, it really helps to know how much you are already eating, which is where a food diary phone app can be very useful. As a starting point you would use a Total Daily Energy Expenditure (TDEE) calculator to get an approximate figure for how many calories you are burning per day, and then add at least 500kcal to that as a daily food consumption target. Eating 500kcal/day more than what you are burning will result in an approximate weight gain of 0.5kg/week, so that is a good starting point from which you can monitor your progress, and adjust as necessary. You will be surprised by how much food you need to eat, and it will take practice to eat that much. You will be forcing yourself to eat much more and more frequently than you otherwise would. For example, a well-known old school method for getting skinny kids to gain weight is a diet called "GOMAD", which involves drinking a gallon of (full fat) milk a day, on top of a normal diet.
As for where to go from here, I recommend you find a strength training coach who can teach you how to lift. I would particularly recommend a Starting Strength coach, if there's one available where you live, but failing that, any powerlifting coach would also be very useful. Definitely don't just turn up at a random gym and expect them to be able to help you though, as most gyms are designed purely as money-making ventures, with the primary concern being to churn though as many people (and hence as many membership fees) as possible, without concern for clients' outcomes. Instead, search online for a barbell strength training coach, as that is what will get you by far the best results.
A year later, if you've hit that 76kg goal, then you could reasonably start considering whether you want to begin working on getting a visible 6-pack.