Can I use my spouse's country to qualify for the DV lottery?
Yes, if your birth country is excluded and your spouse's is eligible, but both of you must be issued visas and enter together.
Yes, in the narrow way the rules allow. If you were born in a country that is excluded from the program and your spouse was born in an eligible one, you may claim your spouse's country of birth as your own "chargeability", and the claim works only if both of you are issued diversity visas and enter the United States together (travel.state.gov: Diversity Visa Program). Your spouse has to be real, legal and in the process, not a name on a form.
What "chargeability" means
Visas are counted against a country, and for a diversity visa it normally follows your country of birth. The statute allows an alternative for a married couple: a person can be charged to the spouse's country of birth when the spouse is also entitled to the visa. The same rule lets a person claim a parent's country in limited cases. The State Department's yearly instructions describe how each alternative is claimed on the entry form.
How the claim is made
On the entry form, the entrant states the country of eligibility and gives the spouse's details. If the entry is selected, the case is processed as one family:
The principal and the spouse both complete Form DS-260.
Both attend the interview and are checked for admissibility.
Both must be issued visas, in the same fiscal year, and enter together or one follows the other under the rules for derivative visas.
If only one spouse is cleared, the claim fails, because the whole basis is that the two belong to the same case.
What can go wrong
A marriage that is not documented. The officer asks for a marriage certificate, and for earlier marriage records if there were any. A marriage entered into to claim the other country is treated as fraud.
A spouse who cannot get a visa. A criminal record or other inadmissibility for the spouse ends the claim for both.
Separating the couple. If the marriage ends before the visa is issued, the claim is lost.
Counting the wrong country. The spouse's country of birth, not citizenship, is what is used. A spouse who is a citizen of an eligible country but born elsewhere does not qualify through it.
Entering twice. Using the spouse's country on one entry and your own on another is a duplicate entry.
What to do
Check the excluded list for the year, confirm that your spouse's birth country is eligible, read the entry instructions on how to state it, and keep the marriage evidence ready from the start. A couple who plan this route should also check that the spouse meets the education or work requirement on their own, because both of you have to be issued visas.
If the family history involves earlier marriages, several nationalities or a child from a previous relationship, an immigration attorney can read the facts against the instructions before the entry window.