Xingqiu is a Hydro element support type character. His elemental skill can act as a shield for your character since it reduces damage taken and increases your resistance to interruption, as well as some small heal if you ascend him once. His elemental burst will also create some rain swords, but unlike the elemental skill, the rain swords will not shatter when you take damage and will last until the duration is over. Additionally, water swords will rain whenever you do a normal attack. This can be really good if paired with another party member that can take advantage of elemental reaction like Lisa, or Diluc for more damage.
If you want to build him as your main DPS, you can either build him with full Noblesse Oblige, or 2 piece Noblesse with 2 piece Gladiators Finale. Use the ones that you have better substats, and focus on attack% mainstats, while going for Hydro damage up on the cup, and crit rate/damage on the crown. Energy Recharge on the hourglass is also really good to use, if you don't use weapons with energy recharge as the secondary.
Sacrificial Sword is an important weapon fo Xinqiu. Getting a reset is essentially more damage, as well as more energy to reach your elemental burst. If you don't have sacrificial sword from the gacha, consider getting the The Black Sword from the battle pass. It has crit rate as the secondary, so you can use crit damage main stat on your crown artifact piece.
His support build is somewhat similar to the DPS build, though it's often better to use 4 piece noblesse on him since he won't be on the field for very long. If you don't have sacrificial sword on him, then it's recommended that you focus more on energy recharge to reach his burst faster.
Since Xingqiu works best as a support, you can pretty much put him on any team to help deal damage. He's especially good if your main damage dealer uses normal attacks often, and can also apply any element to cause a reaction for more damage. Diluc/Razor/Chongyun are common pairs that works well together since they use normal attacks often. Ningguang main DPS also takes advantage of Xingqiu's burst since she spams normal attacks often, with increased survivability because Xingqiu's ability reduces damage taken as well.