It's up to the DM.
You can use the rules for Objects in the Dungeon Master's Guide. The sword is likely made of steel, so it would have AC 19. It's a small resilient object, giving it 3d6 (10) hit points. Since it's a magical item, it should have resistance to all damage, according to the Dungeon Master's Guide (see "Magic Item Resilience").
If this seems to make the sword too fragile, the DM could assign a damage threshold:
An object with a damage threshold has immunity to all damage unless it takes an amount of damage from a single attack or effect equal to or greater than its damage threshold, in which case it takes damage as normal. Any damage that fails to meet or exceed the object’s damage threshold is considered superficial and doesn’t reduce the object’s hit points.
Grabbing the sword
The DM could allow a character to attempt to grab the sword. But even if a character can grab the sword, they cannot take control of it, since it requires attunement to use. They could however prevent the sword from moving, with creative use of their spells and equipment.
How the sword interacts with the battlefield
Note that the Dancing Sword is not a creature and therefore does not provoke opportunity attacks as it moves, doesn't have actions or reactions, and doesn't make opportunity attacks. It also does not occupy its space. Any character is free to move past the sword, as it would any other small object.