Start with the most rhythmic part of your song, usually the percussion section or other tempo-keeping instrument, and record a full four-measure phrase of your song in that instrument.
Highlight and copy the recorded section in its entirety, then paste the copied section after the original on the same track. It won't be perfectly lined up due to the pause between the time you stopped playing and when you hit "Stop Recording". To fix this, zoom into the audio track and delete small sections of the audio track's dead space between beats until the measures line up perfectly. Once you've got this accomplished, you can copy and paste these measures against one another as many times as you like, to form a perfect time-keeping beat track as long as you'd like your song to be.
Record your other instruments in full four-measure phrases on top of the beat track by enabling the "play other tracks while recording new track" feature available in most recording programs. Repeat the editing procedure to create looping tracks of every instrument, and edit them together to your taste.