He may be throwing temper tantrums. If that is the only way he gets attention from you in form of being pampered or getting what he wants, then such behaviour will increase.
Best solution is to give a TIME OUT, where he will be ignored by everyone or placed in a seperate room where he will not get any attention, until he behaves well. These things have to be done repeatedly enough for him to develop an association between "getting cranky & not getting attention ", "behaving well & getting attention, love & care". He will have to be praised & given small gifts for good behaviour for increasing good behaiour whereas unacceptable behaviour needs to be dealt with in the manner explained above for it to decrease.
Next Steps
Try the above techniques persistently for few months for it to be successfull.