I have got IBM x3650 M4 server. It is configured with Raid 5 & includes 4 SAS hard disk with capacity of 500 GB each. Now the 2 Hard disk are showing as bad. So by replacing the 2 hard drives with new one will the data get rebuild automatically or do I need to do some other changes. I do not know much about Raid configuration so please help.
If you lose more than a single disk in a RAID 5, your array has been irreperably damaged in some way. In most cases, the data is entirely destroyed in your case if you're not an expert at recovery, or if you are unwilling to ship it off to a recovery outfit. If you DO want to recover the data from this array, take it offline immediately and either recover it on your own or send the array + the card off to someone like DriveSavers.
This is one of the reasons it's generally advised to stay away from RAID 5, and use RAID 6, 10, or some level of RAID-Z or unRAID.
Now would be a great time to restore from backup. If you intend to create a new array with new disks, you might also consider giving these remaining disks the axe if they're just as old.
So just to clarify, you had a 4-disk R5 array, you replaced 2 disks at once - is that right?
will the data get rebuild automatically or do I need to do some other changes
If what I'm reading you've done is correct then no, no it won't get rebuilt, ever and you've destroyed your data and yes you will have to do some other changes in that you'll have to wipe the array and restore from your last backup.
If I've misread your question then please clarify, otherwise you played yourself.