First,
the (immigrant) "visa" (IR-1) for your husband would be easy, as long as you (1) either have family in the US willing to co-sign an Affidavit of Support (form I-864) in his behalf, or (2) you have sufficient assets to pull this off yourself.
To get this going, you'd file an I-130 petition for your husband with the USCIS. About 5 months later it will be approved, forwarded to the National Visa Center (NVC) and they contact you, ask for the I-864, accompanied by your latest federal income tax returns. If you haven't filed any, do it now, for at least 2018, 2017, and 2016, whether you owe a penny or not. You'd have to document your taxable income, or the lack thereof, either way. Since your income does not derive from US sources, you'd either need the aforementioned co-sponsor, or you can pull this off with assets 3 times the required income (if you don't have kids, that's only $21,137).
https://www.uscis.gov/i-864pAfter he's been interviewed at the US consulate, he gets his IR-1 and, upon arrival in the US ("being admitted"), he's a Green Card holder and can rock 'n roll at his heart's desire.
There are still a few EU countries that do DCF, which is the abbreviation for Direct Consular Filing, which is a great deal easier. Since you forgot to mention in which country you live, I can't be more specific.
In any case, I have the feeling that this is not what you want to do. To answer your question, the only way to get SS credits is to earn US income in the Estados Unidos. Minimum income for 2018 to get all 4 credits was only $5,445, so you could just claim income in that amount on a 1099 form (starting 2019). You'd pay self-employment taxes on that amount, but that's it. It's the easiest way to collect the missing credits.