Yes, you can put a squat rack on second floor. If it's all your house, you only need to worry about the floor. Plywood, gym or other rubber matting, and a deadlift platform will all help make things easier for your floor. You have to consider your neighbors if you live in an apartment, especially if there's someone living under you.