Ubuntu's requirements say that it needs "at least 256MB of RAM" and "4GB of disk space". Now, you could probably tweak the install so it requires less disk space and less RAM. If you don't want to do that, you can use another Linux distro targeted for older hardware. Linux can easily run on old hardware with little RAM and hard drive space.