1. Keep off the grass.

2. keep the grass off.
---------------------------
What is the part of speech of 'off' Is 'off' an adverb or a preposition?
Can we use #2?

"keep off" is one of those phrasal verbs that you don't separate. "Off" is normally a preposition.

http://guidetogrammar.org/grammar/verbs.htm#phrasal

1 is correct; 2 is incorrect.