Hi and welcome to Just Answer!
Please see IRS publication 523 - http://www.irs.gov/pub/irs-pdf/p523.pdfIf you fail to meet the requirements to qualify for the $250,000 or $500,000 exclusion, you may still qualify for a reduced exclusion. This applies to those who:--Fail to meet the ownership and use tests, or--Have used the exclusion within 2 years of selling their current home.In both cases, to qualify for a reduced exclusion, the sale of your main home must be due to one of the following reasons.--A change in place of employment.--Health.--Unforeseen circumstances.
Because the property was owned and used for 18 months - the reduced exclusion for your situation is $500,000 / 24months * 18months = $375,000.Thus because your gain is less - none will be taxable.
If you moved due to a change in your job or business location, or because you started a new job or business, you may be able to deduct your reasonable moving expenses but not any expenses for meals. To qualify for the moving expense deduction, you must satisfy two tests. Under the first test, the "distance test," your new workplace must be at least 50 miles farther from your old home than your old job location was from your old home. If you had no previous workplace, your new job location must be at least 50 miles from your old home.
The second test is the "time test." If you are an employee, you must work full-time for at least 39 weeks during the first 12 months immediately following your arrival in the general area of your new job location. If you are self-employed, you must work full time for at least 39 weeks during the first 12 months and for a total of at least 78 weeks during the first 24 months immediately following your arrival in the general area of your new work location. There are exceptions to the time test in case of death, disability and involuntary separation, among other things.
If you are a member of the armed forces and your move was due to a military order and permanent change of station, you do not have to satisfy the "distance or time tests."
Moving expenses are figured on Form 3903 , Moving Expenses, and deducted as an adjustment to income on Form 1040 . You cannot deduct any moving expenses covered by reimbursements from your employer that are excluded from income.
For more information on deductible and nondeductible moving expenses, refer to Publication 521, Moving Expenses.