Theory of Rare-earth Infinite Layer Nickelates