You will need to print and mail your return if you are filing a joint return with a spouse who died in 2018. This is a security measure. The Social Security Administration marked their SSN as deceased so the return cannot be e-filed.
If they died prior to 2018, you would not include them on your return.