How to make a realistic sword swinging mechanic?

I will explain my question via sceneraio examples. Your character has a sword, and there is an enemy with a shield and a heavy armor, you can only damage him by hitting the gaps (unarmored areas), if you hit his shield or armor, he will not be affected and your chracater will go back to base sword holding animation without waiting for the swinging animation to finish. Animation shifting stuff is probably very standard but I don’t know about it. Anyways, my real question is, which methods should I use to achive this? By any means, like how to detect hit, how animations should work?