Issue with custom rig animating with sword

I wanted to create a custom rig using blender but I got an issue with animating it with a sword,
Have there any ways to animate a custom character with a sword ?
there is a video where the issue is similar to mine:

How I can recreate a custom rig like in world zero :