Taxes

1. Can I write off gas and mileage when traveling for work? 

2. When tracking milage for self employment, should it only be to and from my home address? I mostly work remotely, but I also do site visits. If I live in Central CA, but was remotely working in Northern CA and had a 5 hour drive to get to work in Southern CA instead of a 2 hour drive from my home address. How do I accurately track the milage.