How many Relays we can connect with one Respberry Pi? and can we connect two respberry devices with each other for home automation?
The number of relays is an open ended question.You can have as many relays as your configuration allows you to have. If you are using expansion boards that is your limit. If you are using SPI controlled relays then probably the max amount the SPI addressing allows you to have.
You can connect two Pi's together but you will need to write software to control them independently. Its not like you can just chaining Pi's and get a cluster. Like a mobile phone.. if you have 2 phones, they have 2 OS's doesn't mean using FaceBook on two mobiles will make it run faster.