IRS Reject Codes - F1040-510
1
REJECTION CODE F1040-510
Primary Taxpayer Was Claimed As A Dependent on Another Return
If your return was rejected because you were claimed as a dependent on another return, double-check the personal information you entered. If your name, SSN, or other data is incorrect, fix the mistake and resubmit your return. See Changing Basic Information (Name, SSN, Birthdate) FAQ for details. 
If the primary taxpayer information was entered correctly on your rejected return, you have two options.

First Option
You can indicate that you can be claimed as a dependent on another return and e-file your return. Once you receive your refund, you can amend your return. The IRS will review the amendment and adjust the tax returns appropriately.
Once your return has been accepted by the IRS, you can go back into your return and create the amendment. Go to the Dependent of Another Taxpayer Filing Their Own Return FAQ. 
To create your amendment (after the original return has been accepted), see the steps in Form 1040-X – Filing an Amended Individual Federal Tax Return

Second Option
You can print a paper-return and mail it to the IRS with the proper documentation proving you cannot be claimed on another return.

Note. The second option will take longer to receive a refund because the IRS will need to investigate each return to determine who has the right to claim you as a dependent and adjust the returns appropriately, before issuing a refund.
Proper documentation can include school records, doctor's records, or legal documentation.
The IRS will continue to reject attempts to e-file this return until you make this correction, no matter which tax preparation method is used.