Excess HSA Contribution 2024

My husband and I got married Feb 2024. 

We both had separate Self-Only HSA plans during 2024. 

I contributed $423 and he contributed $507 over the self-only annual 2024 limit. 

Both of our accounts have had the money invested. I only carry $50 in my HSA and he carries around $1000. The rest is invested in stocks. 

 

We’re looking to remove the excess prior to filing our taxes this year. We’re a bit confused on how much to remove given our situation, if we qualify for the family limit, and if we do would he be able to withdraw for the both of us.