Teach your dog to lay calmly on his side or back. Someone already mentioned the position I teach all my puppy class students. Initially, all you are asking is for your dog to relax in either position. You may only get a few seconds at first, gradually working up to longer periods of time, such as 5 minutes. This is truly the best position for lots of maintenance work, such as brushing, teeth care, cleaning ears, trimming feet, etc.
Most corgis enjoy the belly rub that goes along with it.
Only let your dog get up while he is completely relaxed, then give him lots of praise. Begin to handle your corgi all over his body. My philosophy is that this body actually belongs to ME, giving me free access to any part I desire, when I desire it, the corgi is just living in the body. Gentle apply pressure to his feet, squeeze the toes so that the nail is readily visible. As your corgi allows you to handle each part of his body without struggling, give him lots of praise.