Rice should be kept sealed in its package, or a container, in a clean, dry and ideally cool spot.
White rice varieties, milled and polished, can be kept literally for years in a cool dry spot. In India, prized Basmati is aged, ideally for at least 10 years.
Brown rice will go rancid after a time due to the natural oil in the bran layer. You will know rice is rancid from an unpleasant odour and taste it will have. Rancidity will be slowed the cooler rice its kept, the ideal is to store in a glass jar in your refrigerator.