You're not the only with this problem, it appears to be quite common! I would recommend the approach and retreat method. Start with just rubbing his legs and as soon as he stands still, retreat. Then move on to picking up his foot for a second or two. As soon as he behaves, set it down and retreat. This will reward your horse for doing the right thing.
If he is really kicking out and you feel unsafe, use an extension of your arm such as a dressage whip or training stick to rub his legs. This will keep you at a safe distance while you get him to accept being touched there. Someone mentioned using a lead rope to teach your horse how to pick up his feet without being in harms away, this is also a good idea if you feel it is necessary.
This method is particularly effective for horses who are kicking out of nervousness. If it is disrespect, the approach and retreat method might still work. If it is disrespect, getting him to move such as backing him up or lunging him right away is probably a better idea. It will teach him that there is a consequence for kicking out, and it will increase his respect for you.
Short video on picking feet:
Avoid kneeling so you can move quickly if needed!
Here is a video of the training stick I was talking about
Hope this helps! Stay safe :)