Define the state: Let = the maximum money you can steal from houses through . With this definition, you know the best outcome at each position without committing to whether you rob the last house.
For : , (take house alone), (take houses and : ). The state at position depends only on earlier positions, so you can fill the table left to right using a simple recurrence.