Only if you are active duty is the commanding officer attestation form needed.
If you have a DD214 (Member 4), you do not need the commanding officer attestation.
If you are a reservist or you are in the National Guard, and you have a DD214 for your service you are applying for, you do not need a commanding officer attestation.
The commander that signs the form may be your current commander. It does not have to be the commanding officer you deployed with.
Ensure the commander signs each qualifying section and checks off the appropriate blocks. The applicant must sign the bottom of the attestation.