The last thing your small business or startup needs is a law suit.

Beyond the time and expense of going through a potentially lengthy legal battle, it'll assuredly divert your attention away from other important priorities like running your business.

And while having an attorney on speed dial is helpful, patent trouble and liability issues aren't the only legal curve balls that can come your way. Your employees--and even the government, regardless of whether your employees complained--can sue you.

Do yourself a favor, avoid a legal scuffle with workers. Here are six tips that'll help you stay out of court and in compliance with the law:

1. Remember, everyone is born "nonexempt"--that is, they are owed overtime pay if they work more than 40 hours a week. Human resources manager and employee-relations expert Rebecca Goldbach makes it a point to remind managers that a salary exemption isn't a right, and it's not a reward for good performance. Your employee needs to meet the strict criteria for exemption to be ineligible for overtime, per the Fair Labor Standards Act, the federal statute that regulates pay. If they don't meet the exemption, they are not only eligible for overtime, they cannot even waive that right.

2. Stop deducting from your exempt employees' paychecks. There's a trade off with exempt employees. You don't have to pay them overtime, but you also cannot dock their paychecks, even if they leave a hour early or take a long lunch. I've seen people get their pay docked for all these things, and they are all illegal. What's more, if you dock your exempt employee's check for missing partial days, you've automatically made the employee non-exempt and you owe overtime.

3. Follow discrimination law. I got a press release from a startup that proclaimed that they "hired young!" They wanted me to write an article about how great it was that they only hire people in their 20s! I emailed them back and asked if they were aware that they were violating federal law. Silence. I hope they fired whoever came up with that idea. You cannot discriminate on the basis of race, gender, age, national origin, disability, religion and pregnancy status. Some states and localities have additional requirements, such as sexual orientation, as well. Don't do it. It opens you up to a whole host of lawsuits.

4. Don't allow employees to work off the clock. You're a team! You're all in it together! Got it. Your hourly workforce must be paid for every minute they work. Working off the clock is illegal--not for the employee, but for the employer. And, furthermore, even if you say don't do it, but the employee does it anyway, you're still on the hook to pay for their time. You can fire the person, but you must pay first.

5. Cease creating unnecessary rules. You want your business to have a look and feel about it, and you want to promote a certain culture. That's great! But keep your rules limited to what really matters. For instance, you can't say "no head scraves," even if  you want to maintain a certain look among employees. As Abercrombie & Fitch learned, that's a religious discrimination lawsuit waiting to happen. Similarly, health focused companies might want avoid hiring overweight workers. Right now, it's legal to discriminate based on weight, yet it isn't if that weight is considered a disability. And while you may win that lawsuit, remember it costs you to fight. Keep your rules in check and focused on what is necessary for the business.

6. Pay based on the job requirements, and nothing else. Stop trying to base salaries on your employees' previous jobs. Don't base them on how long you've known the person. Base salaries on market demands. If two people are doing the same job, their salaries should be pretty similar (although not exact). They can diverge based on performance, of course, but make sure that's documented. Even if your motives are not based in illegal discrimination, if you pay all your college roommates more than your other employees, and your roommates are all the same gender or race, well, the data is going to look like you're discriminating on race or gender, not roommate status. Remember, just the appearance of wrong doing is enough to land you in court.

If you follow these rules, you can substantially cut your risk of getting sued and of surviving an audit by the government. Also, consider having an employment lawyer on hand in case you have any questions. After all, it's far cheaper to pay an expert for a couple hours a month than it is to fight a lawsuit.