Deductions & credits

Driving from home to work and from work to home (whichever site that is) is your commute and is non-deductible.  If you drive from site A to site B during the same workday, that mileage is deductible no matter how long you stay at site B.  You need to have good documentation, like a diary or log you keep with your car.  Guessing the number of trips may not satisfy the IRS if you are audited.  And, your work expenses are itemized deductions subject to the 2% rule so you may not get an actual benefit from claiming the miles.