In the current legal environment compliance means both following legal rules and regulations exactly as prescribed and meeting the spirit of regulations even if the rules are not 100% clear. Failure to comply with the regulation may result in criticism from a regulator, fines or penalties, and possibly legal action. An interesting point is that generally US regulations are more prescriptive than EU regulations, so where you are located in the world can mean different things.
An example of following an exact regulation comes from Regulation Z, governing credit products. If you are an issuer of credit cards, you must send a customer their credit card statement at least 21 days before their payment due date. If you payment due date is on the 25 of every month, and your credit card company is sending your statement (or making it available online) on the 20th of every month before your
payment is due, they are non-compliant with this regulation.
A compliance example over the spirit of a regulation could be seen looking at the Consumer Financial Protection Bureau's Unfair, Deceptive, or Abusive Acts or Practices (UDAAP) rule. Under UDAAP, if a financial institution is offering a product, the product cannot be unfair, deceptive, or abusive to a customer. These are all legal standards with a great deal of judgment built into the final determination. Still you must comply with the regulation or face a penalty. Taking the 'spirit' or the intent of the regulation into consideration will drive compliance in the absence of a bright line rule.
As a disclaimer, these examples are from the financial services industry. Compliance exists in many different industries. The gist of what compliance means is the same. You are complying with a straight forward rule, complying with the spirit of the rule, or doing both.