You're a hardgainer that's why no matter how much you eat you're still skinny.
First of all, you need to stay away from unhealthy food.
Building muscles and gaining weight is all about mixing your diet with protein, carbohydrate, and fat (good)- rich foods.
I've done some research on gaining weight and even putting on some muscles. and I've discovered that while you're doing this you need to relax and be happy. Feeling frustrated for not being able to put on weight can cause you to lose more weight.
Your diet needs to contain more protein and carbs because these are the building blocks of tissues. You also need to exercise because doing this can make you crave for food. But don't eat before exercising because you'll have abdominal pain, eat after instead.