If your rice is boiling over, it's likely because the water to rice ratio is off. When cooking rice, you should use 1 cup of water for every 1 cup of dry rice. If you add too much water, the rice will absorb it and become overcooked. If you don't add enough water, the rice won't cook properly and will be undercooked and hard.
Another reason your rice might be boiling over is if the pot isn't big enough. When choosing a pot to cook your rice in, make sure it's not too small. The pot should be at least 2-3 times bigger than the amount of dry rice you're using.
Finally, if your pot is too shallow, that can also cause your rice to boil over. A deep pot will help prevent boilovers because it gives the steam somewhere to escape without making a mess on your stovetop.