How do I fix automatic weight problem?
In cases automatic wheight is not working well, manual wheighting is the best solution:
When parenting the model to his rig, choose "with empty group" option.
This will create one vertex group for every bone of your rig.
select the rig, go to pose mode, select the first bone to be weighted, select the model, go to edit mode, select all the vertices you need, In the "vertex group" tab choose the weight you want (from 0.0 to 1.0) and click assign.
Repeat for every bone.
Selecting the model and going to weight paint mode lets you check your work visually.