To gain weight
you need to find the cause for low weight
and treat it. You could be genetically fragile and if this is the case, there may be nothing much you can do about it.
One possibility is that you have an eating disorder. In which case taking help from a doctor specialized in treating eating disorders will help. There are many other causes like worms in stool, depression, anorexia nervosa, AIDS, cancers especially colon cancers, drug abuse, infections and loss of appetite.