You need to run through the basics.
Please go through any of the getting started tutorials. At least go tv.adobe.com and search for After Effects Workflow.
This will help get you started: First, you have to render previews using the 0 key on the numeric keypad. You don't use the space bar. The space bar won't do it. Secondly, you need to set your output module to a codec that will playback smoothly. The default lossless codecs won't.
What Rick said - start with the basics and understand the concepts. As a compositing program, very little in AE is in fact realtime unless you explicitly preview or render to files with suitable settings.