I tried to make an electromagnet at home but when I connect the two copper wires to a 1.5V battery it keeps short circuiting and heating up. Also it doesn't attract other nails.
I'd suggest peeling off just one strand of the wire and use that. You will need to insulate the wire from the nail - Wrapping paper around the nail will do. You will need to insulate the wire from itself, so that adjacent turns don't touch. You can just space the turns out along the paper sleeve. That should do the trick. If you have twine, you can wind that on with the copper wire and use the twine to keep the turns from touching each other.
Oh to straighten copper wire, if you don't know this trick - hold your nail in a vice and wrap a single turn of copper wire around it. If you then pull on one end of the wire, keeping a little tension on the other - with a bit of practice it will give you a very straight end result, as the wire pulls away from the nail.