>>131088
Listen up, OP. Your frame isn't going to keep you from getting muscular. Being underfed for years isn't going to keep you from being muscular (might have affected your height a bit, but who gives a fuck). The only thing that might be problematic about your bones is that due to being really skinny you might not have had great posture, which could lead to spinal issues and the like. This is entirely correctable.
WHAT YOU SHOULD DO
DIET
Start at diet. Aim for a 500 calorie surplus per day on average for the next year or so. Get a decent amount of fats (10% of total calories hard minimum or your hormones will be fucked), a decent amount of protein (shoot for at least 1g per lb bodyweight), and the rest carbs (no sugars). If you don't eat a lot of veggies, a vitamin B complex can help with your metabolism and protein synthesis. If you don't get a lot of sun, take vitamin D3 supplements. Vitamin D is absolutely necessary for regulating the hormones that you depend on for building muscle.
Be prepared to be eating lots of rice, pasta, and oats for those carbs. Whole wheat or whole grain breads are okay, too. Eat as much meat as you can, but stay away from things like hotdogs and low quality garbage protein. Fill in the gaps of your protein quota with whey protein shakes, milk, nuts, etc.
LIFTS
Now on to the fun stuff: programming. I can't stress enough how vital it is that you follow a program with clearly defined progression that won't have you overtraining or killing your joints. A good program should be something that you could do for your entire life if you wanted to. The one I'm on right now is called 5-3-1, and I highly recommend it for someone at any level of lifting experience. It's simple, FUN, flexible, and won't burn you out by having you lifting heavy every single workout. Avoid making up your own program.
First off, there are two types of exercises in a routine: main lifts and assistance lifts. Main lifts are typically the first thing you do in the gym, and will be done with relatively low reps. Your primary goal should always be to increase these lifts because they will give you the biggest reward. Assistance lifts are typically done at medium-to-high reps and are primarily done to get a pump, hit weak points, and promote muscle balance (e.g. since your main lifts will probably involve mostly pushing, pulling assistance work is needed).
Your main lifts, to start out, should be squats, deadlifts, bench press, and overhead press. I don't give a fuck what program you want to run, you need to do these. All 4 of them. Do not think that you can substitute something else for any of them and get the same results. Good assistance lifts that you should consider are rows, chin/pull ups, incline bench press, front squats, good mornings, hanging leg raises, calf raises, lateral raises, face pulls, etc. There are plenty of directories full of exercises organized by muscle group available, and you should try to hit every muscle group at least a little. Don't go too crazy on assistance work, though.
You should always research proper form of any lift, especially multi-joint lifts, before doing them. Research them long before you even go to the gym and don't be afraid to record yourself doing movements on your phone to compare it to videos of good form on jewtube, bb.com, etc. It will help immensely. Practice good form every time yyoutouch a barbell; remember, strength is a skill. Without good form, you will eventually injure yourself and make lackluster gains.
RECOVERY
Another thing that can't be stressed enough is to sleep as much as you can. You only get bigger when you're recovering, and most these gains will be made during periods of deep sleep. If you struggle with that, (I'm not advising you to break the law) marijuana can be helpful to sleep more as well as cause you to be in a state of deep sleep more than REM sleep.
Optional: you could try intermittent fasting if you want to further optimize your hormones. It doesn't make a huge difference imo unless you have insulin resistance or something like that, but when you spend large periods of the day fasting, your human growth hormone levels will rise. IF is basically giving your body fewer insulin spikes by eating fewer, bigger meals. People will typically restrict their eating to a certain stretch of hours in the day, e.g. 8 eating, 16 fasting. Do what works for you. Sustainability in your routine is more important than nutrient timing any day.
It's long winded, but I hope this helps you get started.